Sha256: d6c2b5224f65ed9f6a099f769830f520bbeabfd2a82c22e03a216083d2bd9952

Contents?: true

Size: 694 Bytes

Versions: 9

Compression:

Stored size: 694 Bytes

Contents

require 'migration/page_language'

RSpec.describe Migration::PageLanguage do
  describe '#migrate_pages' do
    let(:exhibit) { FactoryBot.create(:exhibit) }
    let(:page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
    let(:slug) { FriendlyId::Slug.find(page.id) }
    before do
      # Remove the locale scope (anticipating pre translation state of scope)
      slug.scope = slug.scope.sub(',locale:en', '')
      slug.save
      slug.reload
    end
    it 'sets the scope to the default locale' do
      expect(slug.scope).not_to include(',locale:en')
      subject.run
      slug.reload
      expect(slug.scope).to eq "exhibit_id:#{page.exhibit.id},locale:en"
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
blacklight-spotlight-2.0.2 spec/lib/migration/page_language_spec.rb
blacklight-spotlight-2.0.1 spec/lib/migration/page_language_spec.rb
blacklight-spotlight-2.0.0 spec/lib/migration/page_language_spec.rb
blacklight-spotlight-2.0.0.rc6 spec/lib/migration/page_language_spec.rb
blacklight-spotlight-2.0.0.rc5 spec/lib/migration/page_language_spec.rb
blacklight-spotlight-2.0.0.rc4 spec/lib/migration/page_language_spec.rb
blacklight-spotlight-2.0.0.rc3 spec/lib/migration/page_language_spec.rb
blacklight-spotlight-2.0.0.rc2 spec/lib/migration/page_language_spec.rb
blacklight-spotlight-2.0.0.rc1 spec/lib/migration/page_language_spec.rb