Sha256: bcc824716633919ec4267dcf04ddaf59025f17cba6d110e7464e5a47e4b523a6

Contents?: true

Size: 1.05 KB

Versions: 13

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'

describe Helena::SurveyImporter do
  it 'imports a new survey' do
    survey_importer = Helena::SurveyImporter.new File.read(File.dirname(__FILE__) + '/../../db/swls_survey.en.yml')
    survey = survey_importer.survey

    expect(survey).to have_exactly(1).versions
    expect(survey.versions.first).to have_exactly(1).question_groups
    expect(survey.versions.first.question_groups.first).to have_exactly(1).questions
    expect(survey.versions.first.question_groups.first.questions.first).to have_exactly(7).labels
    expect(survey.versions.first.question_groups.first.questions.first.labels.first.position).to eq 1
    expect(survey.versions.first.question_groups.first.questions.first.labels.last.position).to eq 7
    expect(survey.versions.first.question_groups.first.questions.first).to have_exactly(5).sub_questions
    expect(survey.versions.first.question_groups.first.questions.first.sub_questions.first.position).to eq 1
    expect(survey.versions.first.question_groups.first.questions.first.sub_questions.last.position).to eq 5
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
helena-2.1.0 spec/lib/survey_importer_spec.rb
helena-2.0.2 spec/lib/survey_importer_spec.rb
helena-2.0.1 spec/lib/survey_importer_spec.rb
helena-2.0.0 spec/lib/survey_importer_spec.rb
helena-1.3.1 spec/lib/survey_importer_spec.rb
helena-1.3.0 spec/lib/survey_importer_spec.rb
helena-1.1.0 spec/lib/survey_importer_spec.rb
helena-1.0.3 spec/lib/survey_importer_spec.rb
helena-1.0.2 spec/lib/survey_importer_spec.rb
helena-1.0.1 spec/lib/survey_importer_spec.rb
helena-1.0.0.rc4 spec/lib/survey_importer_spec.rb
helena-1.0.0.rc3 spec/lib/survey_importer_spec.rb
helena-1.0.0.rc2 spec/lib/survey_importer_spec.rb