X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/898c1475baaac883442fdf32d16379f1b737052c..970e1a99d7dce64f0631e88c5b9f060fb48d75fe:/test/controllers/changeset_controller_test.rb diff --git a/test/controllers/changeset_controller_test.rb b/test/controllers/changeset_controller_test.rb index 9c77040fe..ca2ff8e15 100644 --- a/test/controllers/changeset_controller_test.rb +++ b/test/controllers/changeset_controller_test.rb @@ -3,7 +3,6 @@ require "changeset_controller" class ChangesetControllerTest < ActionController::TestCase api_fixtures - fixtures :changesets_subscribers ## # test all routes which lead to this controller @@ -1652,6 +1651,7 @@ EOF ## Now try with the public user changeset = changesets(:public_user_first_change) + create(:changeset_tag, :changeset => changeset) new_changeset = changeset.to_xml new_tag = XML::Node.new "tag" new_tag["k"] = "tagtesting" @@ -1989,9 +1989,15 @@ EOF end assert_response :success + changeset = changesets(:normal_user_subscribed_change) + changeset.subscribers.push(users(:normal_user)) + changeset.subscribers.push(users(:public_user)) + changeset.subscribers.push(users(:suspended_user)) + changeset.subscribers.push(users(:deleted_user)) + assert_difference "ChangesetComment.count", 1 do assert_difference "ActionMailer::Base.deliveries.size", 1 do - post :comment, :id => changesets(:normal_user_subscribed_change).id, :text => "This is a comment" + post :comment, :id => changeset.id, :text => "This is a comment" end end assert_response :success @@ -2007,7 +2013,7 @@ EOF assert_difference "ChangesetComment.count", 1 do assert_difference "ActionMailer::Base.deliveries.size", 2 do - post :comment, :id => changesets(:normal_user_subscribed_change).id, :text => "This is a comment" + post :comment, :id => changeset.id, :text => "This is a comment" end end assert_response :success @@ -2098,6 +2104,7 @@ EOF # trying to subscribe when already subscribed changeset = changesets(:normal_user_subscribed_change) + changeset.subscribers.push(users(:public_user)) assert_no_difference "changeset.subscribers.count" do post :subscribe, :id => changeset.id end @@ -2109,6 +2116,7 @@ EOF def test_unsubscribe_success basic_authorization(users(:public_user).email, "test") changeset = changesets(:normal_user_subscribed_change) + changeset.subscribers.push(users(:public_user)) assert_difference "changeset.subscribers.count", -1 do post :unsubscribe, :id => changeset.id