Sha256: d11ffcc86c89812ed44f7ecbd76bfc65c2b8937a28f4b9c52827111c7c62f122

Contents?: true

Size: 750 Bytes

Versions: 38

Compression:

Stored size: 750 Bytes

Contents

require 'spec_helper'

describe AvailableLanguage do
  context "best_locale_for" do
    it 'should return lang receive if suported' do
      AvailableLanguage.best_locale_for("en").should == "en"
    end
  
    it 'should return similar locale if lang received is not supported' do
      AvailableLanguage.best_locale_for("pt").should == "pt-BR"
    end

    it 'should return default locale if lang has no similar locale supported' do
      AvailableLanguage.best_locale_for("ch").should == "en"
    end

    it 'should accept pt_BR pattern' do
      AvailableLanguage.best_locale_for("pt_BR").should == "pt-BR"
    end

    it 'should accept pt-BR pattern' do
      AvailableLanguage.best_locale_for("pt-BR").should == "pt-BR"
    end
  
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
iugusdk-1.0.11 spec/models/available_language_spec.rb
iugusdk-1.0.10 spec/models/available_language_spec.rb
iugusdk-1.0.9 spec/models/available_language_spec.rb
iugusdk-1.0.8 spec/models/available_language_spec.rb
iugusdk-1.0.7 spec/models/available_language_spec.rb
iugusdk-1.0.6 spec/models/available_language_spec.rb
iugusdk-1.0.5 spec/models/available_language_spec.rb
iugusdk-1.0.4 spec/models/available_language_spec.rb
iugusdk-1.0.3 spec/models/available_language_spec.rb
iugusdk-1.0.2 spec/models/available_language_spec.rb
iugusdk-1.0.1 spec/models/available_language_spec.rb
iugusdk-1.0.0.alpha.32 spec/models/available_language_spec.rb
iugusdk-1.0.0.alpha.31 spec/models/available_language_spec.rb
iugusdk-1.0.0.alpha.30 spec/models/available_language_spec.rb
iugusdk-1.0.0.alpha.29 spec/models/available_language_spec.rb
iugusdk-1.0.0.alpha.28 spec/models/available_language_spec.rb
iugusdk-1.0.0.alpha.27 spec/models/available_language_spec.rb
iugusdk-1.0.0.alpha.26 spec/models/available_language_spec.rb
iugusdk-1.0.0.alpha.25 spec/models/available_language_spec.rb
iugusdk-1.0.0.alpha.24 spec/models/available_language_spec.rb