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

Version Path
ccls-surveyor-1.0.0 script/surveyor/specs/answer_spec.rb
jakewendt-surveyor-0.11.3 script/surveyor/specs/answer_spec.rb
surveyor-0.14.5 script/surveyor/specs/answer_spec.rb
surveyor-0.14.4 script/surveyor/specs/answer_spec.rb
surveyor-0.14.3 script/surveyor/specs/answer_spec.rb
surveyor-0.14.2 script/surveyor/specs/answer_spec.rb
surveyor-0.14.1 script/surveyor/specs/answer_spec.rb
surveyor-0.14.0 script/surveyor/specs/answer_spec.rb
surveyor-0.13.0 script/surveyor/specs/answer_spec.rb
surveyor-0.12.1 script/surveyor/specs/answer_spec.rb
surveyor-0.11.0 script/surveyor/specs/answer_spec.rb
surveyor-0.10.0 script/surveyor/specs/answer_spec.rb
surveyor-0.9.10 script/surveyor/specs/answer_spec.rb
surveyor-0.9.9 script/surveyor/specs/answer_spec.rb
surveyor-0.9.8 script/surveyor/specs/answer_spec.rb
surveyor-0.9.7 script/surveyor/specs/answer_spec.rb
surveyor-0.9.6 script/surveyor/specs/answer_spec.rb
surveyor-0.9.5 script/surveyor/specs/answer_spec.rb
surveyor-0.9.4 script/surveyor/specs/answer_spec.rb
surveyor-0.9.3 script/surveyor/specs/answer_spec.rb