Sha256: 640b7fc94e61643cca14a812c8c277846c77047da832fa1bdf67ac6627b79a8a

Contents?: true

Size: 869 Bytes

Versions: 2

Compression:

Stored size: 869 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'survey_section'

describe SurveySection, "when first created" do

  before(:each) do
    @section = SurveySection.new(mock("Survey", :id => 2, :parser => mock("Parser", :new_survey_section_id => 1)), ["Demographics"], {})
  end
  
  it "should generate a data export identifier" do
    @section.data_export_identifier.should == "demographics"
  end
  
  it "should find a question by reference" do
    @section.questions << mock("Question", :reference_identifier => "1", :text => "foo")
    @section.questions << mock("Question", :reference_identifier => "2", :text => "foo")
    @section.questions << mock("Question", :reference_identifier => "3", :text => "foo")
    
    q = @section.find_question_by_reference("2")
    q.should_not be_nil
    q.reference_identifier.should == "2"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
surveyor-0.9.1 script/surveyor/specs/survey_section_spec.rb
surveyor-0.9.0 script/surveyor/specs/survey_section_spec.rb