Sha256: 613998510f6d25b903e12445e29b09072b0a6615c716eb9ef8b0b60fc0a8df6f
Contents?: true
Size: 867 Bytes
Versions: 12
Compression:
Stored size: 867 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe Answer, "when creating a new answer" do before(:each) do @answer = Factory(:answer, :text => "Red") end it "should be valid" do @answer.should be_valid end it "should be invalid without a unique reference identifier (within the scope of its parent)" do @answer.question_id = nil @answer.should_not be_valid end it "should have 'default' renderer with nil question.pick and response_class" do @answer.question = Factory(:question, :pick => nil) @answer.response_class = nil @answer.renderer.should == :default end it "should have a_b renderer for a question.pick and B response_class" do @answer.question = Factory(:question, :pick => "a") @answer.response_class = "B" @answer.renderer.should == :a_b end end
Version data entries
12 entries across 12 versions & 1 rubygems