mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-26 03:58:49 +01:00
Remove the assert_value_changed helper
It's only used in one place and it's easy enough to rewrite this into something more straightforward and less clever.
This commit is contained in:
parent
cf6f9de377
commit
bb8fd08685
2 changed files with 3 additions and 9 deletions
|
|
@ -160,9 +160,9 @@ class UserTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
def test_generate_token_updates_token
|
||||
assert_value_changed @admin_user, :token do
|
||||
@admin_user.send :generate_token
|
||||
end
|
||||
old_token = @admin_user.token
|
||||
@admin_user.generate_token
|
||||
assert_not_equal old_token, @admin_user.token
|
||||
end
|
||||
|
||||
def test_find_admin
|
||||
|
|
|
|||
|
|
@ -33,12 +33,6 @@ class ActiveSupport::TestCase
|
|||
@thursday = Time.zone.local(2008,6,12)
|
||||
end
|
||||
|
||||
# Add more helper methods to be used by all tests here...
|
||||
def assert_value_changed(object, method = nil)
|
||||
initial_value = object.send(method)
|
||||
yield
|
||||
assert_not_equal initial_value, object.send(method), "#{object}##{method}"
|
||||
end
|
||||
# Generates a random string of ascii characters (a-z, "1 0")
|
||||
# of a given length for testing assignment to fields
|
||||
# for validation purposes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue