X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/0d3a9ed9cb47ce3b89ea9eaffbb589f9a9ff6d22..4f05b6a8accae4877f81e617262a52cf0428cf8f:/test/functional/changeset_controller_test.rb diff --git a/test/functional/changeset_controller_test.rb b/test/functional/changeset_controller_test.rb index 21cae1f00..05f2ff569 100644 --- a/test/functional/changeset_controller_test.rb +++ b/test/functional/changeset_controller_test.rb @@ -175,7 +175,7 @@ class ChangesetControllerTest < ActionController::TestCase begin get :read, :id => id assert_response :not_found, "should get a not found" - rescue ActionController::RoutingError => ex + rescue ActionController::UrlGenerationError => ex assert_match /No route matches/, ex.to_s end end @@ -241,7 +241,7 @@ class ChangesetControllerTest < ActionController::TestCase begin put :close, :id => id assert_response :unauthorized, "Shouldn't be able close the non-existant changeset #{id}, when not authorized" - rescue ActionController::RoutingError => ex + rescue ActionController::UrlGenerationError => ex assert_match /No route matches/, ex.to_s end end @@ -252,7 +252,7 @@ class ChangesetControllerTest < ActionController::TestCase begin put :close, :id => id assert_response :not_found, "The changeset #{id} doesn't exist, so can't be closed" - rescue ActionController::RoutingError => ex + rescue ActionController::UrlGenerationError => ex assert_match /No route matches/, ex.to_s end end @@ -1728,14 +1728,14 @@ EOF ## # This should display the last 20 changesets closed. def test_list - changesets = Changeset.find(:all, :order => "created_at DESC", :conditions => ['num_changes > 0'], :limit=> 20) + changesets = Changeset.where("num_changes > 0").order(:created_at => :desc).limit(20) assert changesets.size <= 20 get :list, {:format => "html"} assert_response :success assert_template "list" # Now check that all 20 (or however many were returned) changesets are in the html assert_select "h1", :text => "Changesets", :count => 1 - assert_select "table[id='changeset_list'] tr", :count => changesets.size + assert_select "div[id='changeset_list'] ul", :count => changesets.size changesets.each do |changeset| # FIXME this test needs rewriting - test for table contents end @@ -1762,7 +1762,7 @@ EOF ## # This should display the last 20 changesets closed. def test_feed - changesets = Changeset.find(:all, :order => "created_at DESC", :conditions => ['num_changes > 0'], :limit=> 20) + changesets = Changeset.where("num_changes > 0").order(:created_at => :desc).limit(20) assert changesets.size <= 20 get :feed, {:format => "atom"} assert_response :success