X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/b3759c0d5811579a2a409b9c8c218d605cb62aa4..1be841589acce5e2748037e8d0045e77deacf79d:/test/controllers/changesets_controller_test.rb diff --git a/test/controllers/changesets_controller_test.rb b/test/controllers/changesets_controller_test.rb index 3d264181c..9bbca2ab1 100644 --- a/test/controllers/changesets_controller_test.rb +++ b/test/controllers/changesets_controller_test.rb @@ -92,6 +92,15 @@ class ChangesetsControllerTest < ActionDispatch::IntegrationTest check_index_result(changesets.last(20)) end + ## + # This should report an error + def test_index_invalid_xhr + %w[-1 0 fred].each do |id| + get history_path(:format => "html", :list => "1", :max_id => id) + assert_redirected_to :controller => :errors, :action => :bad_request + end + end + ## # This should display the last 20 changesets closed in a specific area def test_index_bbox @@ -181,8 +190,8 @@ class ChangesetsControllerTest < ActionDispatch::IntegrationTest # Checks the display of the friends changesets listing def test_index_friends private_user = create(:user, :data_public => true) - friendship = create(:friendship, :befriender => private_user) - changeset = create(:changeset, :user => friendship.befriendee, :num_changes => 1) + follow = create(:follow, :follower => private_user) + changeset = create(:changeset, :user => follow.following, :num_changes => 1) _changeset2 = create(:changeset, :user => create(:user), :num_changes => 1) get friend_changesets_path