Sha256: 15fb4443e8281aec7a9eb90495b9945f4a9ca6a8c764d2b61aa2207b39bce0bd

Contents?: true

Size: 758 Bytes

Versions: 3

Compression:

Stored size: 758 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') }

  background do
    reset_spree_preferences
    SolidusI18n::Config.available_locales = [: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

3 entries across 3 versions & 1 rubygems

Version Path
solidus_i18n-1.2.0 spec/features/translations_spec.rb
solidus_i18n-1.1.0 spec/features/translations_spec.rb
solidus_i18n-1.0.0 spec/features/translations_spec.rb