Sha256: 5e788f4f1170576d19f3165dc4b7cb679512e83b4760868118ee4e2ede960b65

Contents?: true

Size: 725 Bytes

Versions: 7

Compression:

Stored size: 725 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)
    spree_get :index
    expect(I18n.locale).to eq(:de)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
solidus_frontend-1.2.3 spec/controllers/controller_helpers_spec.rb
solidus_frontend-1.2.2 spec/controllers/controller_helpers_spec.rb
solidus_frontend-1.2.1 spec/controllers/controller_helpers_spec.rb
solidus_frontend-1.2.0 spec/controllers/controller_helpers_spec.rb
solidus_frontend-1.2.0.rc2 spec/controllers/controller_helpers_spec.rb
solidus_frontend-1.2.0.rc1 spec/controllers/controller_helpers_spec.rb
solidus_frontend-1.2.0.beta1 spec/controllers/controller_helpers_spec.rb