Sha256: b38e4a48c2df3b70aa2caf599391ca3979f455eb7c544326f7f49a6eed2ed68b

Contents?: true

Size: 711 Bytes

Versions: 3

Compression:

Stored size: 711 Bytes

Contents

require 'spec_helper'

class Klass
  include I18n::Backend::Base
end

describe I18n::Backend::Base, '#default' do
  let(:klass) { Klass.new }

  it "posts translations to Locale" do
    with_configuration(:sending_environments => ['my_env'], :environment_name => 'my_env' ) do
      sender = Localeapp::Sender.new
      Localeapp::Sender.should_receive(:new).and_return(sender)
      sender.should_receive(:post_translation)
      klass.default('locale', 'object', 'subject')
    end
  end

  it "doesn't post when sending is disabled" do
    with_configuration(:sending_environments => []) do
      Localeapp::Sender.should_not_receive(:new)
      klass.default('locale', 'object', 'subject')
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
localeapp-0.5.2 spec/localeapp/default_value_handler_spec.rb
localeapp-0.5.1 spec/localeapp/default_value_handler_spec.rb
localeapp-0.5.0 spec/localeapp/default_value_handler_spec.rb