Sha256: 2898d4ee18aac5a9d13d96d6a6cad3c477f9c203e5d5729c539534f8397ca790

Contents?: true

Size: 477 Bytes

Versions: 21

Compression:

Stored size: 477 Bytes

Contents

# frozen_string_literal: true

describe Translation, type: :model do
  let(:exhibit) { FactoryBot.create(:exhibit) }

  describe 'is unique by key, locale, and exhibit' do
    it 'fails validation' do
      described_class.create(exhibit_id: exhibit.id, key: 'abc', locale: 'fr', value: 'yo')
      expect do
        described_class.create(exhibit_id: exhibit.id, key: 'abc', locale: 'fr', value: 'lo')
      end.to raise_error(ActiveRecord::RecordNotUnique)
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
blacklight-spotlight-3.3.0 spec/models/translation_spec.rb
blacklight-spotlight-3.2.0 spec/models/translation_spec.rb
blacklight-spotlight-3.1.0 spec/models/translation_spec.rb
blacklight-spotlight-3.0.3 spec/models/translation_spec.rb
blacklight-spotlight-3.0.2 spec/models/translation_spec.rb
blacklight-spotlight-3.0.1 spec/models/translation_spec.rb
blacklight-spotlight-3.0.0 spec/models/translation_spec.rb
blacklight-spotlight-3.0.0.rc6 spec/models/translation_spec.rb
blacklight-spotlight-3.0.0.rc5 spec/models/translation_spec.rb
blacklight-spotlight-3.0.0.rc4 spec/models/translation_spec.rb
blacklight-spotlight-3.0.0.rc3 spec/models/translation_spec.rb
blacklight-spotlight-3.0.0.rc2 spec/models/translation_spec.rb
blacklight-spotlight-3.0.0.rc1 spec/models/translation_spec.rb
blacklight-spotlight-3.0.0.alpha.10 spec/models/translation_spec.rb
blacklight-spotlight-3.0.0.alpha.9 spec/models/translation_spec.rb
blacklight-spotlight-3.0.0.alpha.8 spec/models/translation_spec.rb
blacklight-spotlight-3.0.0.alpha.7 spec/models/translation_spec.rb
blacklight-spotlight-3.0.0.alpha.6 spec/models/translation_spec.rb
blacklight-spotlight-3.0.0.alpha.5 spec/models/translation_spec.rb
blacklight-spotlight-3.0.0.alpha.4 spec/models/translation_spec.rb