Sha256: 317526a66743a88d81142241597d94a20340008ad41e58fec811b7099add00ca

Contents?: true

Size: 744 Bytes

Versions: 2

Compression:

Stored size: 744 Bytes

Contents

require 'kontena/cli/master/users_command'
require 'kontena/cli/master/users/roles/remove_command'

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

  include ClientHelpers

  let(:subject) do
    described_class.new(File.basename($0))
  end

  describe "#remove-role" do
    before(:each) do
      allow(subject).to receive(:confirm).and_return(true)
    end

    it 'makes remove role request for all given users' do
      expect(client).to receive(:delete).with("users/john@example.org/roles/role").once
      expect(client).to receive(:delete).with("users/jane@example.org/roles/role").once
      expect(subject).to receive(:confirm).once

      subject.run(['role', 'john@example.org', 'jane@example.org'])
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kontena-cli-1.2.0.pre1 spec/kontena/cli/master/users/roles/remove_command_spec.rb
kontena-cli-1.2.0.dev1 spec/kontena/cli/master/users/roles/remove_command_spec.rb