This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def assert_methods(actual, methods = {}) | |
methods.each do |method, value| | |
assert_equal(value, actual.send(method), | |
"For method #{method} expected <#{value}>, got <#{actual.send(method)}>") | |
end | |
end | |
## usage: | |
assert_methods(@user, :name => "Fred", :email => "fred@fred.com", :comment_count => 12) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# using machinist and Authlogic to crat | |
def login!(options = {}) | |
user = User.make(options) | |
set_session_for(user) | |
user | |
end | |
def set_session_for(user) | |
UserSession.create(user) |
NewerOlder