Commit 602762b98d495e31ba481ff0e4aba81ba634d0c5

Authored by Luke Baker
1 parent 5a8e79d5

add test for new revision to question on edit

Showing 1 changed file with 7 additions and 0 deletions   Show diff stats
spec/models/question_spec.rb
... ... @@ -31,6 +31,13 @@ describe Question do
31 31 aoiquestion.median_votes_per_session.should == 2
32 32 end
33 33  
  34 + it "should create a new revision if modified" do
  35 + oldVer = @question.version
  36 + @question.name = "some new name"
  37 + @question.save
  38 + @question.version.should == oldVer + 1
  39 + end
  40 +
34 41 it "should create a new instance given valid attributes" do
35 42 # Factory.attributes_for does not return associations, this is a good enough substitute
36 43 Question.create!(Factory.build(:question).attributes.symbolize_keys)
... ...