X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e7dc2f2e554043b6feed226c577cf135728b74b9..9d9b47ab558d8e4a597711fed5ad596b0b7c5152:/test/controllers/changesets_controller_test.rb diff --git a/test/controllers/changesets_controller_test.rb b/test/controllers/changesets_controller_test.rb index a4f29359b..31a1e2d0c 100644 --- a/test/controllers/changesets_controller_test.rb +++ b/test/controllers/changesets_controller_test.rb @@ -40,6 +40,9 @@ class ChangesetsControllerTest < ActionDispatch::IntegrationTest assert_template "history" assert_template :layout => "map" assert_select "h2", :text => "Changesets", :count => 1 + assert_select "link[rel='alternate'][type='application/atom+xml']", :count => 1 do + assert_select "[href=?]", "http://www.example.com/history/feed" + end get history_path(:format => "html", :list => "1"), :xhr => true assert_response :success @@ -58,6 +61,9 @@ class ChangesetsControllerTest < ActionDispatch::IntegrationTest assert_template "history" assert_template :layout => "xhr" assert_select "h2", :text => "Changesets", :count => 1 + assert_select "link[rel='alternate'][type='application/atom+xml']", :count => 1 do + assert_select "[href=?]", "http://www.example.com/history/feed" + end get history_path(:format => "html", :list => "1"), :xhr => true assert_response :success @@ -84,6 +90,9 @@ class ChangesetsControllerTest < ActionDispatch::IntegrationTest assert_template "history" assert_template :layout => "map" assert_select "h2", :text => "Changesets", :count => 1 + assert_select "link[rel='alternate'][type='application/atom+xml']", :count => 1 do + assert_select "[href=?]", "http://www.example.com/history/feed?bbox=4.5%2C4.5%2C5.5%2C5.5" + end get history_path(:format => "html", :bbox => "4.5,4.5,5.5,5.5", :list => "1"), :xhr => true assert_response :success @@ -102,6 +111,11 @@ class ChangesetsControllerTest < ActionDispatch::IntegrationTest get history_path(:format => "html", :display_name => user.display_name) assert_response :success assert_template "history" + assert_template :layout => "map" + assert_select "h2", :text => "Changesets by #{user.display_name}", :count => 1 + assert_select "link[rel='alternate'][type='application/atom+xml']", :count => 1 do + assert_select "[href=?]", "http://www.example.com/user/#{ERB::Util.url_encode(user.display_name)}/history/feed" + end get history_path(:format => "html", :display_name => user.display_name, :list => "1"), :xhr => true assert_response :success @@ -146,10 +160,11 @@ class ChangesetsControllerTest < ActionDispatch::IntegrationTest private_user = create(:user, :data_public => true) friendship = create(:friendship, :befriender => private_user) changeset = create(:changeset, :user => friendship.befriendee, :num_changes => 1) + _changeset2 = create(:changeset, :user => create(:user), :num_changes => 1) get friend_changesets_path assert_response :redirect - assert_redirected_to :controller => :users, :action => :login, :referer => friend_changesets_path + assert_redirected_to login_path(:referer => friend_changesets_path) session_for(private_user) @@ -169,11 +184,13 @@ class ChangesetsControllerTest < ActionDispatch::IntegrationTest def test_index_nearby private_user = create(:user, :data_public => false, :home_lat => 51.1, :home_lon => 1.0) user = create(:user, :home_lat => 51.0, :home_lon => 1.0) + far_away_user = create(:user, :home_lat => 51.0, :home_lon => 130) changeset = create(:changeset, :user => user, :num_changes => 1) + _changeset2 = create(:changeset, :user => far_away_user, :num_changes => 1) get nearby_changesets_path assert_response :redirect - assert_redirected_to :controller => :users, :action => :login, :referer => nearby_changesets_path + assert_redirected_to login_path(:referer => nearby_changesets_path) session_for(private_user)