Sha256: 15de3f796b7ca307e8c90c049dfa09eba13f55dcbb0609708c4aaa1361124063

Contents?: true

Size: 715 Bytes

Versions: 37

Compression:

Stored size: 715 Bytes

Contents

require 'spec_helper'

# In this file, we want to test that the controller helpers function correctly
# So we need to use one of the controllers inside Spree.
# ProductsController is good.
describe Spree::ProductsController, type: :controller do
  before do
    I18n.enforce_available_locales = false
    Spree::Frontend::Config[:locale] = :de
  end

  after do
    Spree::Frontend::Config[:locale] = :en
    I18n.locale = :en
    I18n.enforce_available_locales = true
  end

  # Regression test for https://github.com/spree/spree/issues/1184
  it "sets the default locale based off Spree::Frontend::Config[:locale]" do
    expect(I18n.locale).to eq(:en)
    get :index
    expect(I18n.locale).to eq(:de)
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
solidus_frontend-2.5.2 spec/controllers/controller_helpers_spec.rb
solidus_frontend-2.5.1 spec/controllers/controller_helpers_spec.rb
solidus_frontend-2.5.0 spec/controllers/controller_helpers_spec.rb
solidus_frontend-2.5.0.rc1 spec/controllers/controller_helpers_spec.rb
solidus_frontend-2.5.0.beta2 spec/controllers/controller_helpers_spec.rb
solidus_frontend-2.5.0.beta1 spec/controllers/controller_helpers_spec.rb
solidus_frontend-2.4.2 spec/controllers/controller_helpers_spec.rb
solidus_frontend-2.2.2 spec/controllers/controller_helpers_spec.rb
solidus_frontend-2.4.1 spec/controllers/controller_helpers_spec.rb
solidus_frontend-2.3.1 spec/controllers/controller_helpers_spec.rb
solidus_frontend-2.1.1 spec/controllers/controller_helpers_spec.rb
solidus_frontend-2.0.3 spec/controllers/controller_helpers_spec.rb
solidus_frontend-1.4.2 spec/controllers/controller_helpers_spec.rb
solidus_frontend-2.4.0 spec/controllers/controller_helpers_spec.rb
solidus_frontend-2.4.0.rc1 spec/controllers/controller_helpers_spec.rb
solidus_frontend-2.4.0.beta1 spec/controllers/controller_helpers_spec.rb
solidus_frontend-2.3.0 spec/controllers/controller_helpers_spec.rb
solidus_frontend-2.3.0.rc3 spec/controllers/controller_helpers_spec.rb
solidus_frontend-2.3.0.rc2 spec/controllers/controller_helpers_spec.rb
solidus_frontend-2.3.0.rc1 spec/controllers/controller_helpers_spec.rb