Sha256: 29b3421f49a947a0a20e042bc0f829c628230cb31b23f5b059dc2189c3869b8c

Contents?: true

Size: 559 Bytes

Versions: 1

Compression:

Stored size: 559 Bytes

Contents

require 'spec_helper'

describe 'LocaleSetter::User' do
  describe '#for' do
    it "ignores a blank stored locale" do
      blank = OpenStruct.new({:locale => ""})
      LocaleSetter::User.for(blank).should_not be
    end

    it "ignores a stored locale that is not available" do
      invalid = OpenStruct.new({:locale => "woof"})
      LocaleSetter::User.for(invalid).should_not be
    end

    it "only tries current_user if it offers a locale" do
      no_locale = OpenStruct.new()
      LocaleSetter::User.for(no_locale).should_not be
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
locale_setter-0.1.0 spec/locale/user_spec.rb