Sha256: 7c80168c40dbdf5fd60d7c84993a61557055beb84cc772408d49289edc1ae956

Contents?: true

Size: 877 Bytes

Versions: 3

Compression:

Stored size: 877 Bytes

Contents

require 'spec_helper'

describe LocaleController do
  # it "should use Spree::BaseController" do
  #   controller.should be_an_instance_of(Spree::BaseController)
  # end

  it "should redirect to index with session[:locale] set to :es" do
    session[:locale].should be_nil
    get 'set', :locale => 'es'
    session[:locale].should == :es
    response.should redirect_to(root_path)
  end
  
  it "should redirect to index with session[:locale] set to :en and not :ru" do
    get 'set', :locale => 'ru'
    session[:locale].should_not == :ru
    session[:locale].should == :en
    response.should redirect_to(root_path)
  end
  
  it "should give url for Spanish" do
    { :get => "/es" }.should route_to(:controller => "locale", :action => "set", :locale => "es")
    { :get => "/ru" }.should_not route_to(:controller => "locale", :action => "set", :locale => "es")
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spree_change_locale-0.5.2 spec/controllers/locale_controller_spec.rb
spree_change_locale-0.5.1 spec/controllers/locale_controller_spec.rb
spree_change_locale-0.5 spec/controllers/locale_controller_spec.rb