]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/changeset_controller_test.rb
Add failing test demonstrating tag duplication when updating traces via the API.
[rails.git] / test / controllers / changeset_controller_test.rb
index f1b029b39d5b2abb902f4771e9a7b90ee78611b3..9bf3a4b8ee0e9d5cbc994f87528bb866a8837f97 100644 (file)
@@ -1321,7 +1321,7 @@ EOF
     node = create(:node)
 
     ## First try with a non-public user, which should get a forbidden
-    basic_authorization(create(:user, :data_public => false).email, "test")
+    basic_authorization create(:user, :data_public => false).email, "test"
 
     # create a temporary changeset
     content "<osm><changeset>" +
@@ -1331,7 +1331,7 @@ EOF
     assert_response :forbidden
 
     ## Now try with a normal user
-    basic_authorization(create(:user).email, "test")
+    basic_authorization create(:user).email, "test"
 
     # create a temporary changeset
     content "<osm><changeset>" +
@@ -1377,7 +1377,7 @@ EOF
   #
   # NOTE: the error turned out to be something else completely!
   def test_josm_upload
-    basic_authorization(create(:user).email, "test")
+    basic_authorization create(:user).email, "test"
 
     # create a temporary changeset
     content "<osm><changeset>" +
@@ -1439,7 +1439,7 @@ OSMFILE
     node = create(:node)
     node2 = create(:node)
     way = create(:way)
-    basic_authorization(create(:user).email, "test")
+    basic_authorization create(:user).email, "test"
 
     # create a temporary changeset
     content "<osm><changeset>" +
@@ -2044,6 +2044,18 @@ EOF
     check_list_result(Changeset.where("id <= 4"))
   end
 
+  ##
+  # Check that a list with a next page link works
+  def test_list_more
+    create_list(:changeset, 50)
+
+    get :list, :params => { :format => "html" }
+    assert_response :success
+
+    get :list, :params => { :format => "html" }, :xhr => true
+    assert_response :success
+  end
+
   ##
   # This should display the last 20 non-empty changesets
   def test_feed
@@ -2135,7 +2147,7 @@ EOF
     deleted_user = create(:user, :deleted)
     private_user_closed_changeset = create(:changeset, :closed, :user => private_user)
 
-    basic_authorization(user.email, "test")
+    basic_authorization user.email, "test"
 
     assert_difference "ChangesetComment.count", 1 do
       assert_no_difference "ActionMailer::Base.deliveries.size" do
@@ -2164,7 +2176,7 @@ EOF
 
     ActionMailer::Base.deliveries.clear
 
-    basic_authorization(user2.email, "test")
+    basic_authorization user2.email, "test"
 
     assert_difference "ChangesetComment.count", 1 do
       assert_difference "ActionMailer::Base.deliveries.size", 2 do
@@ -2193,7 +2205,7 @@ EOF
     post :comment, :params => { :id => create(:changeset, :closed).id, :text => "This is a comment" }
     assert_response :unauthorized
 
-    basic_authorization(create(:user).email, "test")
+    basic_authorization create(:user).email, "test"
 
     # bad changeset id
     assert_no_difference "ChangesetComment.count" do
@@ -2223,7 +2235,7 @@ EOF
   ##
   # test subscribe success
   def test_subscribe_success
-    basic_authorization(create(:user).email, "test")
+    basic_authorization create(:user).email, "test"
     changeset = create(:changeset, :closed)
 
     assert_difference "changeset.subscribers.count", 1 do
@@ -2244,7 +2256,7 @@ EOF
     end
     assert_response :unauthorized
 
-    basic_authorization(user.email, "test")
+    basic_authorization user.email, "test"
 
     # bad changeset id
     assert_no_difference "changeset.subscribers.count" do
@@ -2272,7 +2284,7 @@ EOF
   # test unsubscribe success
   def test_unsubscribe_success
     user = create(:user)
-    basic_authorization(user.email, "test")
+    basic_authorization user.email, "test"
     changeset = create(:changeset, :closed)
     changeset.subscribers.push(user)
 
@@ -2292,7 +2304,7 @@ EOF
     end
     assert_response :unauthorized
 
-    basic_authorization(create(:user).email, "test")
+    basic_authorization create(:user).email, "test"
 
     # bad changeset id
     assert_no_difference "changeset.subscribers.count" do
@@ -2326,14 +2338,14 @@ EOF
     assert_response :unauthorized
     assert_equal true, comment.reload.visible
 
-    basic_authorization(create(:user).email, "test")
+    basic_authorization create(:user).email, "test"
 
     # not a moderator
     post :hide_comment, :params => { :id => comment.id }
     assert_response :forbidden
     assert_equal true, comment.reload.visible
 
-    basic_authorization(create(:moderator_user).email, "test")
+    basic_authorization create(:moderator_user).email, "test"
 
     # bad comment id
     post :hide_comment, :params => { :id => 999111 }
@@ -2347,7 +2359,7 @@ EOF
     comment = create(:changeset_comment)
     assert_equal true, comment.visible
 
-    basic_authorization(create(:moderator_user).email, "test")
+    basic_authorization create(:moderator_user).email, "test"
 
     post :hide_comment, :params => { :id => comment.id }
     assert_response :success
@@ -2365,14 +2377,14 @@ EOF
     assert_response :unauthorized
     assert_equal false, comment.reload.visible
 
-    basic_authorization(create(:user).email, "test")
+    basic_authorization create(:user).email, "test"
 
     # not a moderator
     post :unhide_comment, :params => { :id => comment.id }
     assert_response :forbidden
     assert_equal false, comment.reload.visible
 
-    basic_authorization(create(:moderator_user).email, "test")
+    basic_authorization create(:moderator_user).email, "test"
 
     # bad comment id
     post :unhide_comment, :params => { :id => 999111 }
@@ -2386,7 +2398,7 @@ EOF
     comment = create(:changeset_comment, :visible => false)
     assert_equal false, comment.visible
 
-    basic_authorization(create(:moderator_user).email, "test")
+    basic_authorization create(:moderator_user).email, "test"
 
     post :unhide_comment, :params => { :id => comment.id }
     assert_response :success