mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-08 18:28:50 +01:00
The syntax of assert_difference has changed
You pass it a string now, instead of an object and a method
This commit is contained in:
parent
c459461aa3
commit
0dfb1aafda
5 changed files with 23 additions and 23 deletions
|
|
@ -74,7 +74,7 @@ class TodosControllerTest < ActionController::TestCase
|
|||
end
|
||||
|
||||
def test_create_todo
|
||||
assert_difference Todo, :count do
|
||||
assert_difference 'Todo.count' do
|
||||
login_as(:admin_user)
|
||||
put :create, :_source_view => 'todo', "context_name"=>"library", "project_name"=>"Build a working time machine", "todo"=>{"notes"=>"", "description"=>"Call Warren Buffet to find out how much he makes per day", "due"=>"30/11/2006"}, "tag_list"=>"foo bar"
|
||||
end
|
||||
|
|
@ -82,7 +82,7 @@ class TodosControllerTest < ActionController::TestCase
|
|||
|
||||
def test_create_todo_via_xml
|
||||
login_as(:admin_user)
|
||||
assert_difference Todo, :count do
|
||||
assert_difference 'Todo.count' do
|
||||
put :create, :format => "xml", "request" => { "context_name"=>"library", "project_name"=>"Build a working time machine", "todo"=>{"notes"=>"", "description"=>"Call Warren Buffet to find out how much he makes per day", "due"=>"30/11/2006"}, "tag_list"=>"foo bar" }
|
||||
assert_response 201
|
||||
end
|
||||
|
|
@ -91,7 +91,7 @@ class TodosControllerTest < ActionController::TestCase
|
|||
def test_create_todo_via_xml_show_from
|
||||
login_as(:admin_user)
|
||||
|
||||
assert_difference Todo, :count do
|
||||
assert_difference 'Todo.count' do
|
||||
xml = "<todo><description>Call Warren Buffet to find out how much he makes per day</description><project_id>#{projects(:timemachine).id}</project_id><context_id>#{contexts(:agenda).id}</context_id><show-from type=\"datetime\">#{1.week.from_now.xmlschema}</show-from></todo>"
|
||||
|
||||
# p parse_xml_body(xml)
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ class UsersControllerTest < ActionController::TestCase
|
|||
|
||||
def test_create_adds_a_user
|
||||
login_as :admin_user
|
||||
assert_difference(User, :count) do
|
||||
assert_difference 'User.count' do
|
||||
post :create, :user => {:login => 'newbie', :password => 'newbiepass', :password_confirmation => 'newbiepass'}
|
||||
end
|
||||
end
|
||||
|
|
@ -132,7 +132,7 @@ class UsersControllerTest < ActionController::TestCase
|
|||
#
|
||||
def test_create_by_non_admin
|
||||
login_as :other_user
|
||||
assert_no_difference(User, :count) do
|
||||
assert_no_difference 'User.count' do
|
||||
post :create, :user => {:login => 'newbie2', :password => 'newbiepass2', :password_confirmation => 'newbiepass2'}
|
||||
end
|
||||
assert_response :success
|
||||
|
|
@ -145,7 +145,7 @@ class UsersControllerTest < ActionController::TestCase
|
|||
|
||||
def test_create_with_invalid_password_does_not_add_a_new_user
|
||||
login_as :admin_user
|
||||
assert_no_difference(User, :count) do
|
||||
assert_no_difference 'User.count' do
|
||||
post :create, :user => {:login => 'newbie', :password => '', :password_confirmation => ''}
|
||||
end
|
||||
end
|
||||
|
|
@ -170,7 +170,7 @@ class UsersControllerTest < ActionController::TestCase
|
|||
|
||||
def test_create_with_duplicate_login_does_not_add_a_new_user
|
||||
login_as :admin_user
|
||||
assert_no_difference(User, :count) do
|
||||
assert_no_difference 'User.count' do
|
||||
post :create, :user => {:login => 'jane', :password => 'newbiepass', :password_confirmation => 'newbiepass'}
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue