Skip to content

Commit

Permalink
Add test for write_state_without_persistence
Browse files Browse the repository at this point in the history
  • Loading branch information
zmillman committed May 1, 2012
1 parent c11822e commit 7e297ae
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/test_active_record.rb
Expand Up @@ -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

Expand Down

0 comments on commit 7e297ae

Please sign in to comment.