summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2015-05-02 21:17:41 -0600
committermo khan <mo@mokhan.ca>2015-05-02 21:17:41 -0600
commit237452138741fc61873c2c0318d31a36b09b8324 (patch)
tree666accc4d5db324ee493e5c9e0c5e2b13e5165bf /spec
parent2d78c33c68596d9b667a2ffdcba1a0d05664dd83 (diff)
add user recipe and test capistrano recipe with test-kitchen.
Diffstat (limited to 'spec')
-rw-r--r--spec/default_spec.rb19
-rw-r--r--spec/user_spec.rb13
2 files changed, 13 insertions, 19 deletions
diff --git a/spec/default_spec.rb b/spec/default_spec.rb
index 25ca49a..c50e5a0 100644
--- a/spec/default_spec.rb
+++ b/spec/default_spec.rb
@@ -1,21 +1,2 @@
describe 'mokhan-myface::default' do
- let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '12.04').converge(described_recipe) }
-
- it 'installs apache2' do
- expect(chef_run).to install_package('apache2')
- end
-
- it 'starts the apache2 service' do
- expect(chef_run).to start_service('apache2')
- end
-
- it 'enables apache2 to start on boot' do
- expect(chef_run).to enable_service('apache2')
- end
-
- it 'creates the default template' do
- expect(chef_run).to create_template('/var/www/index.html')
- .with_owner('root')
- .with_group('root')
- end
end
diff --git a/spec/user_spec.rb b/spec/user_spec.rb
new file mode 100644
index 0000000..128a98a
--- /dev/null
+++ b/spec/user_spec.rb
@@ -0,0 +1,13 @@
+describe "mokhan-myface::user" do
+ subject do
+ ChefSpec::SoloRunner.new do |node|
+ node.set['user']['username'] = username
+ end.converge(described_recipe)
+ end
+
+ let(:username) { FFaker::Internet.user_name }
+
+ it 'creates the rails user' do
+ expect(subject).to create_user(username)
+ end
+end