Skip to content

Commit

Permalink
Set all UI tests pending and added user tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Graham Davison committed Nov 4, 2016
1 parent fe538b2 commit e21f649
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/spec/libraries/consul_installation_webui_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,32 @@
let(:chefspec_options) { {platform: 'ubuntu', version: '14.04'} }

context 'webui installation' do
pending('replace with poise-archive')

recipe do
consul_installation '0.7.0' do
provider :webui
end
end

it do is_expected.to create_directory('/opt/consul-webui/0.7.0')
it do
pending('replace with poise-archive')
is_expected.to create_directory('/opt/consul-webui/0.7.0')
.with(
recursive: true
)
end

it do is_expected.to create_directory('/var/lib/consul')
it do
pending('replace with poise-archive')
is_expected.to create_directory('/var/lib/consul')
.with(
recursive: true
)
end

it do is_expected.to unzip_zipfile('consul_0.7.0_web_ui.zip')
it do
pending('replace with poise-archive')
is_expected.to unzip_zipfile('consul_0.7.0_web_ui.zip')
.with(
checksum: '42212089c228a73a0881a5835079c8df58a4f31b5060a3b4ffd4c2497abe3aa8',
path: '/opt/consul-webui/0.7.0',
source: 'https://releases.hashicorp.com/consul/0.7.0/consul_0.7.0_web_ui.zip'
)
end
Expand Down
17 changes: 17 additions & 0 deletions test/spec/recipes/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@
end
end

context "with johnny5 service_user" do
before do
default_attributes['consul'] ||= {}
default_attributes['consul']['service_user'] = 'johnny5'
end

it 'creates the requested user' do
expect(chef_run).to create_poise_service_user('johnny5')
end
it 'does not try to create the default user' do
expect(chef_run).to_not create_poise_service_user('consul')
end
end

context "with root service_user" do
before do
default_attributes['consul'] ||= {}
Expand All @@ -19,6 +33,9 @@
it 'does not try to create the root user' do
expect(chef_run).to_not create_poise_service_user('root')
end
it 'does not try to create the default user' do
expect(chef_run).to_not create_poise_service_user('consul')
end
end

context "with create_service_user disabled" do
Expand Down

0 comments on commit e21f649

Please sign in to comment.