Sha256: 7afea5a31d1aba493a8680df93934f2a7faac6337635cc2586170e93a9be8adb

Contents?: true

Size: 926 Bytes

Versions: 18

Compression:

Stored size: 926 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe Language do
  
  describe "locale_id" do
    before(:all) do
      @language = Factory(:unmodified_language, :locale => 'zz', :supported => true)
    end
    it "should find the language id for the current locale" do
      I18n.should_receive(:locale).and_return(:zz)
      Language.locale_id(true).should == @language.id
    end
  end
  
  describe "supported_locale?" do
    before(:all) do
      @supported_locale = 'zz'
      @not_supported_locale = 'aa'
      @supported_language = Factory(:unmodified_language, :locale => @supported_locale, :supported => true)
    end
    it "should indicate the locale is supported" do
      Language.supported_locale?(@supported_locale, true).should be_true
    end
    it "should indicate the locale is not supported" do
      Language.supported_locale?(@not_supported_locale, true).should_not be_true
    end
  end
  
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
muck-engine-3.5.0 test/spec/models/language_spec.rb
muck-engine-3.4.0 test/spec/models/language_spec.rb
muck-engine-3.3.18 test/spec/models/language_spec.rb
muck-engine-3.3.17 test/spec/models/language_spec.rb
muck-engine-3.3.16 test/spec/models/language_spec.rb
muck-engine-3.3.15 test/spec/models/language_spec.rb
muck-engine-3.3.14 test/spec/models/language_spec.rb
muck-engine-3.3.13 test/spec/models/language_spec.rb
muck-engine-3.3.12 test/spec/models/language_spec.rb
muck-engine-3.3.11 test/spec/models/language_spec.rb
muck-engine-3.3.10 test/spec/models/language_spec.rb
muck-engine-3.3.6 test/spec/models/language_spec.rb
muck-engine-3.0.8 test/rails_test/spec/models/language_spec.rb
muck-engine-3.0.7 test/rails_test/spec/models/language_spec.rb
muck-engine-3.0.6 test/rails_test/spec/models/language_spec.rb
muck-engine-3.0.5 test/rails_test/spec/models/language_spec.rb
muck-engine-3.0.4 test/rails_test/spec/models/language_spec.rb
muck-engine-3.0.3 test/rails_test/spec/models/language_spec.rb