Sha256: 0a5263bfd5af42d1166dea20ae84771f6743deac0d9cbf56a6ede4f292e8c1dd

Contents?: true

Size: 919 Bytes

Versions: 89

Compression:

Stored size: 919 Bytes

Contents

require_relative "../../../../spec_helper"
require 'kontena/cli/master/users_command'
require "kontena/cli/master/users/remove_command"

describe Kontena::Cli::Master::Users::RemoveCommand do

  include ClientHelpers

  describe '#execute' do

    before(:each) do
      allow(subject).to receive(:confirm).and_return(true)
    end

    it 'requires api url' do
      expect(subject).to receive(:require_api_url).once
      subject.run(['john@domain.com'])
    end

    it 'it requires confirmation' do
      expect(subject).to receive(:confirm).once
      subject.run(['john@domain.com'])
    end

    it 'requires token' do
      expect(subject).to receive(:require_token).and_return(token)
      subject.run(['john@domain.com'])
    end

    it 'sends email to master' do
      expect(client).to receive(:delete).with(
        'users/john@domain.com'
      )
      subject.run(['john@domain.com'])
    end
  end
end

Version data entries

89 entries across 89 versions & 1 rubygems

Version Path
kontena-cli-1.1.6 spec/kontena/cli/master/users/remove_command_spec.rb
kontena-cli-1.1.5 spec/kontena/cli/master/users/remove_command_spec.rb
kontena-cli-1.1.5.rc3 spec/kontena/cli/master/users/remove_command_spec.rb
kontena-cli-1.1.5.rc2 spec/kontena/cli/master/users/remove_command_spec.rb
kontena-cli-1.1.5.rc1 spec/kontena/cli/master/users/remove_command_spec.rb
kontena-cli-1.1.4 spec/kontena/cli/master/users/remove_command_spec.rb
kontena-cli-1.1.3 spec/kontena/cli/master/users/remove_command_spec.rb
kontena-cli-1.1.2 spec/kontena/cli/master/users/remove_command_spec.rb
kontena-cli-1.1.2.rc2 spec/kontena/cli/master/users/remove_command_spec.rb
kontena-cli-1.1.2.rc1 spec/kontena/cli/master/users/remove_command_spec.rb
kontena-cli-1.1.1 spec/kontena/cli/master/users/remove_command_spec.rb
kontena-cli-1.1.1.rc1 spec/kontena/cli/master/users/remove_command_spec.rb
kontena-cli-1.1.0 spec/kontena/cli/master/users/remove_command_spec.rb
kontena-cli-1.1.0.rc2 spec/kontena/cli/master/users/remove_command_spec.rb
kontena-cli-1.1.0.rc1 spec/kontena/cli/master/users/remove_command_spec.rb
kontena-cli-1.1.0.pre1 spec/kontena/cli/master/users/remove_command_spec.rb
kontena-cli-1.0.6 spec/kontena/cli/master/users/remove_command_spec.rb
kontena-cli-1.0.6.rc1 spec/kontena/cli/master/users/remove_command_spec.rb
kontena-cli-1.0.5 spec/kontena/cli/master/users/remove_command_spec.rb
kontena-cli-1.0.5.rc1 spec/kontena/cli/master/users/remove_command_spec.rb