Sha256: bdfe2dee809e4e54458094135a42f1a6f7e4979c769f248a7221e404a86fb897
Contents?: true
Size: 818 Bytes
Versions: 24
Compression:
Stored size: 818 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 question_id" 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
24 entries across 24 versions & 3 rubygems