Skip to content

Commit

Permalink
Added test for nil attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
phene authored and wireframe committed Jun 15, 2010
1 parent 7a1cb2b commit 23bab69
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/acts_as_stripped_test.rb
Expand Up @@ -34,6 +34,19 @@ class ActsAsStrippedTest < Test::Unit::TestCase
assert_equal 'ryan', @user.first_name assert_equal 'ryan', @user.first_name
assert_equal 'sonnek', @user.last_name assert_equal 'sonnek', @user.last_name
end end

should "not fail if any attributes are nil" do
@user.first_name = ' shaq '
@user.last_name = nil
@user.logged_in_at = Time.now

assert_nothing_raised do
@user.save!
end

assert_equal 'shaq', @user.first_name
assert_nil @user.last_name
end
end end


context 'a basic post instance' do context 'a basic post instance' do
Expand Down

0 comments on commit 23bab69

Please sign in to comment.