Permalink
Browse files

Add test for write_state_without_persistence

  • Loading branch information...
1 parent c11822e commit 7e297ae190b391dbedec297305812f13dafaa248 @zmillman zmillman committed May 1, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 test/test_active_record.rb
View
7 test/test_active_record.rb
@@ -164,6 +164,13 @@ def setup
@light.update_attribute(:state, 'green')
assert @light.reload.green?, "reloaded state should come from database, not instance variable"
end
+
+ test "calling non-bang event updates state attribute" do
+ @light.reset
+ assert @light.red?
+ @light.green_on
+ assert_equal "green", @light.state
+ end
end

0 comments on commit 7e297ae

Please sign in to comment.