Sha256: 67eb7eee4db0f04787dac3800b67c7366e4a1d3f1446d03dc2d05670cbab91ad
Contents?: true
Size: 982 Bytes
Versions: 21
Compression:
Stored size: 982 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/spec_helper') require 'answer' describe SurveyParser::Answer, " when first created" do before(:each) do question = mock("Question", :id => 2, :parser => mock("SurveyParser::Parser", :new_answer_id => 1)) question.stub!(:class => SurveyParser::Question) options = {:help_text => "Never or rarely ever", :reference_identifier => "b3a_1"} @ans = SurveyParser::Answer.new(question, ["No / Rarely"], options) end it "should set inititalized variables to those passed in" do @ans.id.should == 1 @ans.question_id.should == 2 @ans.reference_identifier.should == "b3a_1" @ans.text.should == "No / Rarely" @ans.help_text.should == "Never or rarely ever" end it "should output current state to yml" do @ans.should.respond_to?(:to_yml) end it "should create a normalized code automatically when initalized" do @ans.data_export_identifier.should eql("no_rarely") end end
Version data entries
21 entries across 21 versions & 3 rubygems