Sha256: c43808e4da64d0abf1ee52351d909a50f59d222420c852acebb82b639bb3719e

Contents?: true

Size: 552 Bytes

Versions: 12

Compression:

Stored size: 552 Bytes

Contents

# frozen_string_literal: true

describe Spotlight::CustomTranslationExtension do
  let(:exhibit) { FactoryBot.create(:exhibit) }
  subject do
    Class.new(ActiveRecord::Base) do
      include Spotlight::CustomTranslationExtension
    end
  end

  describe '.current_exhibit' do
    it 'sets the current exhibit' do
      subject.current_exhibit = exhibit
      expect(subject.current_exhibit).to eq exhibit
    end

    it 'reloads the i18n' do
      allow(I18n.backend).to receive(:reload!)

      subject.current_exhibit = exhibit
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
blacklight-spotlight-3.0.0.alpha.2 spec/models/spotlight/custom_translation_extension_spec.rb
blacklight-spotlight-3.0.0.alpha.1 spec/models/spotlight/custom_translation_extension_spec.rb
blacklight-spotlight-2.13.0 spec/models/spotlight/custom_translation_extension_spec.rb
blacklight-spotlight-2.12.1 spec/models/spotlight/custom_translation_extension_spec.rb
blacklight-spotlight-2.12.0 spec/models/spotlight/custom_translation_extension_spec.rb
blacklight-spotlight-2.11.0 spec/models/spotlight/custom_translation_extension_spec.rb
blacklight-spotlight-2.10.0 spec/models/spotlight/custom_translation_extension_spec.rb
blacklight-spotlight-2.9.0 spec/models/spotlight/custom_translation_extension_spec.rb
blacklight-spotlight-2.8.0 spec/models/spotlight/custom_translation_extension_spec.rb
blacklight-spotlight-2.7.2 spec/models/spotlight/custom_translation_extension_spec.rb
blacklight-spotlight-2.7.1 spec/models/spotlight/custom_translation_extension_spec.rb
blacklight-spotlight-2.7.0 spec/models/spotlight/custom_translation_extension_spec.rb