1 require 'spec_helper_acceptance'
3 describe 'rabbitmq user:' do
4 context 'create user resource' do
5 it 'runs successfully' do
7 if $facts['os']['family'] == 'RedHat' {
8 class { 'erlang': epel_enable => true }
9 Class['erlang'] -> Class['rabbitmq']
12 service_manage => true,
14 delete_guest_user => true,
18 rabbitmq_user { 'dan':
24 apply_manifest(pp, catch_failures: true)
25 apply_manifest(pp, catch_changes: true)
28 # rubocop:disable RSpec/MultipleExpectations
30 shell('rabbitmqctl list_users -q') do |r|
31 expect(r.stdout).to match(%r{dan.*administrator})
32 expect(r.exit_code).to be_zero
35 # rubocop:enable RSpec/MultipleExpectations
38 context 'destroy user resource' do
39 it 'runs successfully' do
41 rabbitmq_user { 'dan':
46 apply_manifest(pp, catch_failures: true)
47 apply_manifest(pp, catch_changes: true)
50 it 'does not have the user' do
51 shell('rabbitmqctl list_users -q') do |r|
52 expect(r.stdout).not_to match(%r{dan\s+})