Sha256: b9822aab6fe2eee3ff9027d9e60776a1cb1a612dc24bc101f25217c6936b188b

Contents?: true

Size: 784 Bytes

Versions: 16

Compression:

Stored size: 784 Bytes

Contents

require 'spec_helper'

describe Localeapp::CLI::Add, "#execute(current_name, new_name, *rest)" do
  def do_action(current_name = 'test.key', new_name = 'test.new_name')
    @command.execute(current_name, new_name)
  end

  before(:each) do
    @output = StringIO.new
    @command = Localeapp::CLI::Rename.new(:output => @output)
  end

  it "makes the api call to the translations endpoint with the new name as the post body" do
    with_configuration do
      @command.should_receive(:api_call).with(
        :rename,
        :url_options => { :current_name => 'test.key' },
        :payload => { :new_name => 'test.new_name' },
        :success => :report_success,
        :failure => :report_failure,
        :max_connection_attempts => 3
      )
      do_action
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
localeapp-0.9.3 spec/localeapp/cli/rename_spec.rb
localeapp-0.9.2 spec/localeapp/cli/rename_spec.rb
localeapp-0.9.1 spec/localeapp/cli/rename_spec.rb
localeapp-0.9.0 spec/localeapp/cli/rename_spec.rb
localeapp-0.8.1 spec/localeapp/cli/rename_spec.rb
localeapp-0.8.0 spec/localeapp/cli/rename_spec.rb
localeapp-0.7.2 spec/localeapp/cli/rename_spec.rb
localeapp-0.7.1 spec/localeapp/cli/rename_spec.rb
localeapp-0.7.0 spec/localeapp/cli/rename_spec.rb
localeapp-0.6.14 spec/localeapp/cli/rename_spec.rb
localeapp-0.6.13 spec/localeapp/cli/rename_spec.rb
localeapp-0.6.12 spec/localeapp/cli/rename_spec.rb
localeapp-0.6.10 spec/localeapp/cli/rename_spec.rb
localeapp-0.6.9 spec/localeapp/cli/rename_spec.rb
localeapp-0.6.8 spec/localeapp/cli/rename_spec.rb
localeapp-0.6.7 spec/localeapp/cli/rename_spec.rb