Sha256: b6f7d3a7659bb444693f26d596c3e3053bb27a96a895f4f3254058eca09a4a12

Contents?: true

Size: 1019 Bytes

Versions: 1

Compression:

Stored size: 1019 Bytes

Contents

require 'spec_helper'
require 'locale_app/missing_translations'

describe LocaleApp::MissingTranslations, "#add(locale, key, options = {})" do
  it "stores the missing translation data" do
    translations = LocaleApp::MissingTranslations.new
    translations.add(:en, 'foo', { :baz => 'bam' })
    translations[:en].should include('foo')
    translations[:en]['foo'].options.should == { :baz => 'bam' }
  end
end

describe LocaleApp::MissingTranslations, "#to_send" do
  it "returns an array of missing translation data that needs to be sent to localeapp.com" do
    translations = LocaleApp::MissingTranslations.new
    translations.add(:en, 'foo', { :baz => 'bam' })
    translations.add(:es, 'bar')

    to_send = translations.to_send
    to_send.size.should == 2
    to_send[0][:key].should == 'foo'
    to_send[0][:locale].should == :en
    to_send[0][:options].should == { :baz => 'bam' }
    to_send[1][:key].should == 'bar'
    to_send[1][:locale].should == :es
    to_send[1][:options].should == {}
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
localeapp-0.0.7 spec/locale_app/missing_translations_spec.rb