Sha256: 87e4117661d5e9890a1f1d96bc81c29257b504339fc3b7e9a3438ce26ccb73bd

Contents?: true

Size: 1.56 KB

Versions: 5

Compression:

Stored size: 1.56 KB

Contents

require 'spec_helper'

describe Conjur::Command::Groups, logged_in: true do
  describe_command "group:members:add group user:alice" do
    it "adds the role to the group" do
           RestClient::Request.should_receive(:execute).with(
        method: :put,
        url: "https://authz.example.com/the-account/roles/group/group/?members&member=user:alice",
        headers: {},
        payload: nil
      )
      invoke
    end
  end

  describe_command "group:members:add -a group user:alice" do
    it "adds the role to the group with admin option" do
       RestClient::Request.should_receive(:execute).with(
        method: :put,
        url: "https://authz.example.com/the-account/roles/group/group/?members&member=user:alice",
        headers: {},
        payload: { admin_option: true }
      )
      invoke
    end
  end
  describe_command "group:members:add -a group alice" do
    it "assumes that a nake member name is a user" do
           RestClient::Request.should_receive(:execute).with(
        method: :put,
        url: "https://authz.example.com/the-account/roles/group/group/?members&member=user:alice",
        headers: {},
        payload: { admin_option: true }
      )
      invoke
    end
  end

  describe_command "group:members:add -r group alice" do
    it "revokes the admin rights" do
       RestClient::Request.should_receive(:execute).with(
        method: :put,
        url: "https://authz.example.com/the-account/roles/group/group/?members&member=user:alice",
        headers: {},
        payload: { admin_option: false }
      )
      invoke
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
conjur-cli-4.14.0 spec/command/groups_spec.rb
conjur-cli-4.13.1 spec/command/groups_spec.rb
conjur-cli-4.12.0 spec/command/groups_spec.rb
conjur-cli-4.10.3 spec/command/groups_spec.rb
conjur-cli-4.10.1 spec/command/groups_spec.rb