Fix test failures
This commit is contained in:
parent
44629832dd
commit
e91956d0f7
58 changed files with 231 additions and 363 deletions
|
@ -56,25 +56,13 @@ class ChangesetControllerTest < ActionController::TestCase
|
|||
{ :controller => "changeset", :action => "list", :nearby => true }
|
||||
)
|
||||
assert_routing(
|
||||
{ :path => "/browse/changesets", :method => :get },
|
||||
{ :path => "/history", :method => :get },
|
||||
{ :controller => "changeset", :action => "list" }
|
||||
)
|
||||
assert_routing(
|
||||
{ :path => "/browse/changesets/feed", :method => :get },
|
||||
{ :path => "/history/feed", :method => :get },
|
||||
{ :controller => "changeset", :action => "feed", :format => :atom }
|
||||
)
|
||||
assert_recognizes(
|
||||
{ :controller => "changeset", :action => "list" },
|
||||
{ :path => "/browse", :method => :get }
|
||||
)
|
||||
assert_recognizes(
|
||||
{ :controller => "changeset", :action => "list" },
|
||||
{ :path => "/history", :method => :get }
|
||||
)
|
||||
assert_recognizes(
|
||||
{ :controller => "changeset", :action => "feed", :format => :atom },
|
||||
{ :path => "/history/feed", :method => :get }
|
||||
)
|
||||
end
|
||||
|
||||
# -----------------------
|
||||
|
@ -1728,14 +1716,23 @@ EOF
|
|||
##
|
||||
# This should display the last 20 changesets closed.
|
||||
def test_list
|
||||
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 "changeset/history"
|
||||
assert_select "h2", :text => "Changesets", :count => 1
|
||||
|
||||
get :list, {:format => "html", :bbox => '-180,-90,90,180'}
|
||||
assert_response :success
|
||||
assert_template "list"
|
||||
|
||||
changesets = Changeset.
|
||||
where("num_changes > 0 and min_lon is not null").
|
||||
order(:created_at => :desc).
|
||||
limit(20)
|
||||
assert changesets.size <= 20
|
||||
|
||||
# Now check that all 20 (or however many were returned) changesets are in the html
|
||||
assert_select "h1", :text => "Changesets", :count => 1
|
||||
assert_select "div[id='changeset_list'] ul", :count => changesets.size
|
||||
assert_select "li", :count => changesets.size
|
||||
changesets.each do |changeset|
|
||||
# FIXME this test needs rewriting - test for table contents
|
||||
end
|
||||
|
@ -1747,7 +1744,7 @@ EOF
|
|||
user = users(:public_user)
|
||||
get :list, {:format => "html", :display_name => user.display_name}
|
||||
assert_response :success
|
||||
assert_template "changeset/_user"
|
||||
assert_template "changeset/history"
|
||||
## FIXME need to add more checks to see which if edits are actually shown if your data is public
|
||||
end
|
||||
|
||||
|
@ -1781,7 +1778,8 @@ EOF
|
|||
user = users(:public_user)
|
||||
get :feed, {:format => "atom", :display_name => user.display_name}
|
||||
assert_response :success
|
||||
assert_template "changeset/_user"
|
||||
assert_template "changeset/list"
|
||||
assert_equal "application/atom+xml", response.content_type
|
||||
## FIXME need to add more checks to see which if edits are actually shown if your data is public
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue