Sha256: 8526c3dd67052d354ebe9db9e3748023fd08fb44f2422dce30fbcd2c1cc2ec18

Contents?: true

Size: 592 Bytes

Versions: 4

Compression:

Stored size: 592 Bytes

Contents

require 'rails_helper'

module CitizenBudgetModel
  RSpec.describe Section, type: :model do
    it { should validate_presence_of :simulator_id }

    describe '#name' do
      it 'should return the title' do
        expect(Section.new(title_en_ca: 'Section').display_name).to eq('Section')
        expect(Section.new(title_fr_ca: 'Section').display_name).to eq('Section')
      end

      it 'should return the default title' do
        expect(Section.new.display_name).to eq('Untitled')
        expect(Section.new(title_en_ca: '').display_name).to eq('Untitled')
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
citizen_budget_model-0.0.4 spec/models/citizen_budget_model/section_spec.rb
citizen_budget_model-0.0.3 spec/models/citizen_budget_model/section_spec.rb
citizen_budget_model-0.0.2 spec/models/citizen_budget_model/section_spec.rb
citizen_budget_model-0.0.1 spec/models/citizen_budget_model/section_spec.rb