X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ca92fe3359ce2a751763b1bb0bfe824a89b20853..f156928100332034b706096fcf1e92d1f0d42e05:/test/controllers/changesets_controller_test.rb diff --git a/test/controllers/changesets_controller_test.rb b/test/controllers/changesets_controller_test.rb index a5ce2aa62..d9a4b256b 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 @@ -150,7 +164,7 @@ class ChangesetsControllerTest < ActionDispatch::IntegrationTest 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) @@ -176,7 +190,7 @@ class ChangesetsControllerTest < ActionDispatch::IntegrationTest 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) @@ -307,7 +321,7 @@ class ChangesetsControllerTest < ActionDispatch::IntegrationTest ## # check the result of a feed def check_feed_result(changesets) - assert changesets.size <= 20 + assert_operator changesets.size, :<=, 20 assert_select "feed", :count => [changesets.size, 1].min do assert_select "> title", :count => 1, :text => /^Changesets/ @@ -315,6 +329,14 @@ class ChangesetsControllerTest < ActionDispatch::IntegrationTest changesets.each do |changeset| assert_select "> entry > id", changeset_url(:id => changeset.id) + + assert_select "> entry > content > xhtml|div > xhtml|table" do + assert_select "> xhtml|tr > xhtml|td > xhtml|table" do + changeset.tags.each_key do |key| + assert_select "> xhtml|tr > xhtml|td", :text => /^#{key} = / + end + end + end end end end