Sha256: 1d0b4d861f2e87bd1c8efd134b36f0e5b7d8dac8a771065e82f9fd40969fdea1
Contents?: true
Size: 1.31 KB
Versions: 4
Compression:
Stored size: 1.31 KB
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 # this causes issues with building and saving answers to questions within a grid. # it "should be invalid without a question_id" do # @answer.question_id = nil # @answer.should_not be_valid # end it "should tell me its css class" do @answer.custom_class = "foo bar" @answer.css_class.should == "foo bar" @answer.is_exclusive = true @answer.css_class.should == "exclusive foo bar" end it "should hide the label when hide_label is set" do @answer.split_or_hidden_text.should == "Red" @answer.hide_label = true @answer.split_or_hidden_text.should == "" end it "should split up pre/post labels" do @answer.text = "before|after|extra" @answer.split_or_hidden_text(:pre).should == "before" @answer.split_or_hidden_text(:post).should == "after|extra" end it "should delete validation when it is deleted" do v_id = Factory(:validation, :answer => @answer).id @answer.destroy Validation.find_by_id(v_id).should be_nil end it "should have an api_id" do @answer.api_id.length.should == 36 end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
surveyor-0.19.7 | spec/models/answer_spec.rb |
surveyor-0.19.6 | spec/models/answer_spec.rb |
surveyor-0.19.5 | spec/models/answer_spec.rb |
surveyor-0.19.4 | spec/models/answer_spec.rb |