Created
April 11, 2010 02:29
-
-
Save mrkurt/362449 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| diff --git a/spec/unit/mongoid/dirty_spec.rb b/spec/unit/mongoid/dirty_spec.rb | |
| index e412abc..43103c9 100644 | |
| --- a/spec/unit/mongoid/dirty_spec.rb | |
| +++ b/spec/unit/mongoid/dirty_spec.rb | |
| @@ -45,6 +45,18 @@ describe Mongoid::Dirty do | |
| end | |
| end | |
| + context "when the attribute is mutated in place" do | |
| + before do | |
| + @person = Person.new(:title => "Grand Poobah") | |
| + @person.title.sub!("Grand", "Most High") | |
| + end | |
| + | |
| + it "tracks field changes" do | |
| + @person.attribute_change("title").should == | |
| + [ "Grand Poobah", "Most High Poobah" ] | |
| + end | |
| + end | |
| + | |
| context "when the attribute is removed" do | |
| before do |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment