From 602762b98d495e31ba481ff0e4aba81ba634d0c5 Mon Sep 17 00:00:00 2001 From: Luke Baker Date: Thu, 16 Jun 2011 16:07:42 -0400 Subject: [PATCH] add test for new revision to question on edit --- spec/models/question_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+), 0 deletions(-) diff --git a/spec/models/question_spec.rb b/spec/models/question_spec.rb index c4662d4..1aeda28 100644 --- a/spec/models/question_spec.rb +++ b/spec/models/question_spec.rb @@ -31,6 +31,13 @@ describe Question do aoiquestion.median_votes_per_session.should == 2 end + it "should create a new revision if modified" do + oldVer = @question.version + @question.name = "some new name" + @question.save + @question.version.should == oldVer + 1 + end + it "should create a new instance given valid attributes" do # Factory.attributes_for does not return associations, this is a good enough substitute Question.create!(Factory.build(:question).attributes.symbolize_keys) -- libgit2 0.21.2