diff --git a/README.md b/README.md index 560d0d6c..50aaddf7 100644 --- a/README.md +++ b/README.md @@ -736,7 +736,7 @@ Remember to add those extra columns to your `versions` table and use `attr_acces There are two scenarios: diffing adjacent versions and diffing non-adjacent versions. -The best way to diff adjacent versions is to get PaperTrail to do it for you. If you add an `object_changes` text column to your `versions` table, either at installation time with the `--with-changes` option or manually, PaperTrail will store the `changes` diff (excluding any attributes PaperTrail is ignoring) in each `update` version. You can use the `version.changeset` method to retrieve it. For example: +The best way to diff adjacent versions is to get PaperTrail to do it for you. If you add an `object_changes` text column to your `versions` table, either at installation time with the `rails generate paper_trail:install --with-changes` option or manually, PaperTrail will store the `changes` diff (excluding any attributes PaperTrail is ignoring) in each `update` version. You can use the `version.changeset` method to retrieve it. For example: ```ruby >> widget = Widget.create :name => 'Bob' diff --git a/spec/requests/articles_spec.rb b/spec/requests/articles_spec.rb index 5f8f83ca..b3606619 100644 --- a/spec/requests/articles_spec.rb +++ b/spec/requests/articles_spec.rb @@ -4,14 +4,16 @@ describe "Articles" do let(:valid_params) { { :article => { :title => 'Doh', :content => Faker::Lorem.sentence } } } context "versioning disabled" do - specify { PaperTrail.enabled?.should be_false } + specify { PaperTrail.should_not be_enabled } it "should not create a version" do + PaperTrail.should be_enabled_for_controller expect { post articles_path(valid_params) }.to_not change(PaperTrail::Version, :count) + PaperTrail.should_not be_enabled_for_controller end - it "should not leak the state of the `PaperTrail.enabled_for_controlller?` into the next test" do - PaperTrail.enabled_for_controller?.should be_true + it "should not leak the state of the `PaperTrail.enabled_for_controller?` into the next test" do + PaperTrail.should be_enabled_for_controller end end end