Sha256: 4b5caba4cbaf611b756461f5866e022a26a460a6dc9fe4a6c9004af7fd03c6b4

Contents?: true

Size: 818 Bytes

Versions: 6

Compression:

Stored size: 818 Bytes

Contents

require "spec_helper"

describe Localeapp::CLI::Copy, "#execute(source_name, dest_name, *rest)" do
  def do_action(source_name = "test.source_name", dest_name = "test.dest_name")
    @command.execute(source_name, dest_name)
  end

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

  it "makes the api call to the translations endpoint with the destination name as the post body" do
    with_configuration do
      expect(@command).to receive(:api_call).with(
        :copy,
        :url_options => { :source_name => "test.source_name" },
        :payload => { :dest_name => "test.dest_name" },
        :success => :report_success,
        :failure => :report_failure,
        :max_connection_attempts => anything
      )
      do_action
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
localeapp-3.3.0 spec/localeapp/cli/copy_spec.rb
localeapp-3.2.0 spec/localeapp/cli/copy_spec.rb
localeapp-3.1.3 spec/localeapp/cli/copy_spec.rb
localeapp-3.1.2 spec/localeapp/cli/copy_spec.rb
localeapp-3.1.1 spec/localeapp/cli/copy_spec.rb
localeapp-3.1.0 spec/localeapp/cli/copy_spec.rb