Sha256: 0132a86fc68ffd9d4f53ae6fb41c96313272c173138d5f4855fc12c12fa5742a

Contents?: true

Size: 795 Bytes

Versions: 12

Compression:

Stored size: 795 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
      expect(@command).to 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 => anything
      )
      do_action
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
localeapp-3.3.0 spec/localeapp/cli/rename_spec.rb
localeapp-3.2.0 spec/localeapp/cli/rename_spec.rb
localeapp-3.1.3 spec/localeapp/cli/rename_spec.rb
localeapp-3.1.2 spec/localeapp/cli/rename_spec.rb
localeapp-3.1.1 spec/localeapp/cli/rename_spec.rb
localeapp-3.1.0 spec/localeapp/cli/rename_spec.rb
localeapp-3.0.1 spec/localeapp/cli/rename_spec.rb
localeapp-3.0.0 spec/localeapp/cli/rename_spec.rb
localeapp-2.5.0 spec/localeapp/cli/rename_spec.rb
localeapp-2.4.0 spec/localeapp/cli/rename_spec.rb
localeapp-2.3.0 spec/localeapp/cli/rename_spec.rb
localeapp-2.2.0 spec/localeapp/cli/rename_spec.rb