mirror of
https://github.com/paper-trail-gem/paper_trail.git
synced 2022-11-09 11:33:19 -05:00
Whitespace.
This commit is contained in:
parent
e5388ac4e3
commit
8c0931c8f3
1 changed files with 9 additions and 9 deletions
|
@ -14,7 +14,7 @@ class HasPaperTrailModelTest < ActiveSupport::TestCase
|
||||||
setup { @article.update_attributes :title => 'My first title', :content => 'Some text here.' }
|
setup { @article.update_attributes :title => 'My first title', :content => 'Some text here.' }
|
||||||
should_change('the number of versions', :by => 1) { Version.count }
|
should_change('the number of versions', :by => 1) { Version.count }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'which updates a selected column' do
|
context 'which updates a selected column' do
|
||||||
setup { @article.update_attributes :content => 'Some text here.' }
|
setup { @article.update_attributes :content => 'Some text here.' }
|
||||||
should_change('the number of versions', :by => 1) { Version.count }
|
should_change('the number of versions', :by => 1) { Version.count }
|
||||||
|
@ -24,7 +24,7 @@ class HasPaperTrailModelTest < ActiveSupport::TestCase
|
||||||
setup { @article.update_attributes :abstract => 'Other abstract'}
|
setup { @article.update_attributes :abstract => 'Other abstract'}
|
||||||
should_not_change('the number of versions') { Version.count }
|
should_not_change('the number of versions') { Version.count }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -712,36 +712,36 @@ class HasPaperTrailModelTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
context 'A new model instance which uses a custom Version class' do
|
context 'A new model instance which uses a custom Version class' do
|
||||||
setup { @post = Post.new }
|
setup { @post = Post.new }
|
||||||
|
|
||||||
context 'which is then saved' do
|
context 'which is then saved' do
|
||||||
setup { @post.save }
|
setup { @post.save }
|
||||||
should_change('the number of post versions') { PostVersion.count }
|
should_change('the number of post versions') { PostVersion.count }
|
||||||
should_not_change('the number of versions') { Version.count }
|
should_not_change('the number of versions') { Version.count }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'An existing model instance which uses a custom Version class' do
|
context 'An existing model instance which uses a custom Version class' do
|
||||||
setup { @post = Post.create }
|
setup { @post = Post.create }
|
||||||
|
|
||||||
context 'on the first version' do
|
context 'on the first version' do
|
||||||
setup { @version = @post.versions.first }
|
setup { @version = @post.versions.first }
|
||||||
|
|
||||||
should 'have the correct index' do
|
should 'have the correct index' do
|
||||||
assert_equal 0, @version.index
|
assert_equal 0, @version.index
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
should 'should have versions of the custom class' do
|
should 'should have versions of the custom class' do
|
||||||
assert_equal "PostVersion", @post.versions.first.class.name
|
assert_equal "PostVersion", @post.versions.first.class.name
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'which is modified' do
|
context 'which is modified' do
|
||||||
setup { @post.update_attributes({ :content => "Some new content" }) }
|
setup { @post.update_attributes({ :content => "Some new content" }) }
|
||||||
should_change('the number of post versions') { PostVersion.count }
|
should_change('the number of post versions') { PostVersion.count }
|
||||||
should_not_change('the number of versions') { Version.count }
|
should_not_change('the number of versions') { Version.count }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
context 'An overwritten default accessor' do
|
context 'An overwritten default accessor' do
|
||||||
setup do
|
setup do
|
||||||
|
|
Loading…
Reference in a new issue