Sha256: 6e73cc4e9da7139b5b5bc8557cca2cd075946ccf0b707f4478631e4cde386f58

Contents?: true

Size: 691 Bytes

Versions: 6

Compression:

Stored size: 691 Bytes

Contents

require 'spec_helper'

describe GlobalizeTranslation do

  let(:i18n_title) { Factory(:i18n_title) }
  let(:i18n_title_pl) { Factory(:i18n_title_pl) }

  it "has a :title key" do
    i18n_title.key.should eql('title')
  end

  it "returns all translations for all locales" do
    [i18n_title, i18n_title_pl].map(&:value).should =~ GlobalizeTranslation.lookup(:title).map(&:value)
  end

  it "returns a translation for scoped locale" do
    i18n_title.value.should eq(GlobalizeTranslation.locale('en').lookup(:title).first.value)
  end

  it "lists available locales" do
    [i18n_title, i18n_title_pl].map(&:locale).map(&:to_sym).should =~ GlobalizeTranslation.available_locales
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
exvo_globalize-0.3.1 spec/models/globalize_translation_spec.rb
exvo_globalize-0.3.0 spec/models/globalize_translation_spec.rb
exvo_globalize-0.2.1 spec/models/globalize_translation_spec.rb
exvo_globalize-0.2.0 spec/models/globalize_translation_spec.rb
exvo_globalize-0.1.0 spec/models/globalize_translation_spec.rb
exvo_globalize-0.0.2 spec/models/globalize_translation_spec.rb