Sha256: 59a51b3c3fb59d4d5ce8ab8b0b74d7eebc636fea3326dc7de1a4ad4dc4fe0dd2

Contents?: true

Size: 813 Bytes

Versions: 4

Compression:

Stored size: 813 Bytes

Contents

require 'spec_helper'

module Quby::Questionnaires::Entities
  describe SubScoreSchema do
    let(:key) { :totaal }
    let(:export_key) { :tot }
    let(:options) { {key: key, export_key: export_key, label: 'Somscore'} }
    subject { SubScoreSchema.new options }

    it 'is valid' do
      expect(subject).to be_valid
    end

    describe 'if key is not a symbol' do
      let(:key) { 'totaal' }
      it 'is invalid' do
        expect(subject).to be_invalid
        expect(subject.errors.full_messages).to eq(["Key is not a symbol"])
      end
    end

    describe 'if export_key is not a symbol' do
      let(:export_key) { 'tot' }
      it 'is invalid' do
        expect(subject).to be_invalid
        expect(subject.errors.full_messages).to eq(["Export key is not a symbol"])
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
quby-3.2.2 spec/quby/questionnaires/entities/sub_score_schema_spec.rb
quby-3.2.1 spec/quby/questionnaires/entities/sub_score_schema_spec.rb
quby-3.2.0 spec/quby/questionnaires/entities/sub_score_schema_spec.rb
quby-3.2.0.pre.pre1 spec/quby/questionnaires/entities/sub_score_schema_spec.rb