From 692c0c39b68a77057526781a83dabe56a6931fa0 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 31 May 2017 17:53:07 +0100 Subject: [PATCH] Create objects via factories, rather than implicity relying on fixtures. --- test/controllers/changeset_controller_test.rb | 62 +++++++++++-------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/test/controllers/changeset_controller_test.rb b/test/controllers/changeset_controller_test.rb index 50a66744a..5f156ee1b 100644 --- a/test/controllers/changeset_controller_test.rb +++ b/test/controllers/changeset_controller_test.rb @@ -424,6 +424,9 @@ EOF def test_upload_create_valid user = create(:user) changeset = create(:changeset, :user => user) + node = create(:node) + way = create(:way_with_nodes, :nodes_count => 2) + relation = create(:relation) basic_authorization user.email, "test" @@ -436,14 +439,14 @@ EOF - + - - - + + + @@ -870,6 +873,7 @@ EOF ## # upload multiple versions of the same element in the same diff. def test_upload_multiple_valid + node = create(:node) changeset = create(:changeset) basic_authorization changeset.user.email, "test" @@ -879,14 +883,14 @@ EOF diff = < - - - - - - - - + + + + + + + + EOF @@ -907,6 +911,7 @@ EOF # upload multiple versions of the same element in the same diff, but # keep the version numbers the same. def test_upload_multiple_duplicate + node = create(:node) changeset = create(:changeset) basic_authorization changeset.user.email, "test" @@ -914,8 +919,8 @@ EOF diff = < - - + + EOF @@ -1315,6 +1320,8 @@ EOF # when we make some simple changes we get the same changes back from the # diff download. def test_diff_download_simple + node = create(:node) + ## First try with a non-public user, which should get a forbidden basic_authorization(create(:user, :data_public => false).email, "test") @@ -1340,14 +1347,14 @@ EOF diff = < - - - - - - - - + + + + + + + + EOF @@ -1431,6 +1438,9 @@ OSMFILE # when we make some complex changes we get the same changes back from the # diff download. def test_diff_download_complex + node = create(:node) + node2 = create(:node) + way = create(:way) basic_authorization(create(:user).email, "test") # create a temporary changeset @@ -1445,7 +1455,7 @@ OSMFILE diff = < - + @@ -1453,9 +1463,9 @@ OSMFILE - - - + + + -- 2.39.5