Sha256: b7017e86c96a782b57e76e89fb958335794a5b4cb3b531a82498cd7093d7174c

Contents?: true

Size: 805 Bytes

Versions: 1

Compression:

Stored size: 805 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

RSpec.feature 'Translations', :js do
  given(:language) { Spree.t(:this_file_language, scope: 'i18n', locale: 'pt-BR') }
  given(:store) { create(:store) }

  background do
    reset_spree_preferences
    store.update_attributes(preferred_available_locales: %i[en pt-BR])
  end

  context 'page' do
    context 'switches locale from the dropdown' do
      before do
        visit spree.root_path
        select(language, from: Spree.t(:language, scope: 'i18n'))
      end

      scenario 'selected translation is applied' do
        expect(page).to have_content(/#{Spree.t(:home, locale: 'pt-BR')}/i)
      end

      scenario 'JS cart link is translated' do
        expect(page).to have_content(/#{Spree.t(:cart, locale: 'pt-BR')}/i)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_i18n-1.3.0 spec/features/translations_spec.rb