From: Andy Allan Date: Wed, 31 May 2017 16:53:07 +0000 (+0100) Subject: Create objects via factories, rather than implicity relying on fixtures. X-Git-Tag: live~3410 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/692c0c39b68a77057526781a83dabe56a6931fa0?ds=sidebyside Create objects via factories, rather than implicity relying on fixtures. --- 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 - - - + + +