Sha256: cc1726ba924501d8f562cc65b1ae25d87b033528f78059259d90a3fab1eb11ab

Contents?: true

Size: 549 Bytes

Versions: 1

Compression:

Stored size: 549 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

RSpec.describe Breadcrumby::Home, '.name' do
  subject { described_class.new view }

  let!(:view) { double }

  context 'when i18n key is not defined' do
    it 'returns a default name' do
      expect(subject.name).to eq 'Home'
    end
  end

  context 'when i18n key is defined' do
    before do
      allow(I18n).to receive(:t).with('breadcrumby.home.name', default: 'Home') { 'Start' }
    end

    it 'returns a default name' do
      expect(subject.name).to eq 'Start'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
breadcrumby-0.1.0 spec/lib/breadcrumby/models/home/name_spec.rb