On Mon, Aug 23, 2010 at 2:09 PM, Marnen Laibow-Koser
<[email protected]> wrote:
> ...and you've conveniently left out the hard-to-read assert statements.
test "should have a first name" do
count = User.count( :all )
u = User.new( :email => '[email protected]', :password =>
'xxxxxxxx', :lname => 'foobar', :last_login => Time.now )
assert !u.valid?
assert_not_nil u.errors[:fname]
assert_equal count, User.count( :all )
u.fname = 'foo'
assert u.save
assert_equal count + 1, User.count( :all )
end
test "user can login" do
get :login
assert_response :success
post :login, { :login => { :email => '[email protected]',
:password => 'changeme' } }
assert_redirected_to '/'
assert_not_nil session[:user_id]
end
What's so hard to read?
--
Greg Donald
destiney.com | gregdonald.com
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.