use shared_examples_for versioning, for both posts and topics

This commit is contained in:
Grant Ammons
2013-02-08 08:17:05 -05:00
parent e925d53463
commit a8c106bba6
3 changed files with 15 additions and 4 deletions

View File

@@ -0,0 +1,12 @@
shared_examples_for "a versioned model" do
let(:model) { Fabricate(described_class.to_s.downcase) }
let(:first_version_at) { model.last_version_at }
it 'should be versioned' do
model.should respond_to(:version)
end
it 'has an initial version of 1' do
model.version.should == 1
end
end