Add separate test for :ignore attribute.
This commit is contained in:
parent
3e26b4453b
commit
df4eaab360
|
@ -1,3 +1,4 @@
|
|||
class LegacyWidget < ActiveRecord::Base
|
||||
has_paper_trail :version_name => 'custom_version'
|
||||
has_paper_trail :ignore => :version,
|
||||
:version_name => 'custom_version'
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'test_helper'
|
|||
|
||||
class HasPaperTrailModelTest < ActiveSupport::TestCase
|
||||
|
||||
context 'A record' do
|
||||
context 'A record with defined "only" and "ignore" attributes' do
|
||||
setup { @article = Article.create }
|
||||
|
||||
context 'which updates an ignored column' do
|
||||
|
@ -57,7 +57,15 @@ class HasPaperTrailModelTest < ActiveSupport::TestCase
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'A record with defined "ignore" attribute' do
|
||||
setup { @legacy_widget = LegacyWidget.create }
|
||||
|
||||
context 'which updates an ignored column' do
|
||||
setup { @legacy_widget.update_attributes :version => 1 }
|
||||
should_not_change('the number of versions') { Version.count }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue