summaryrefslogtreecommitdiff
path: root/spec/rails_spec.rb
blob: 23665015e4d7624c02e6545b5e7c930c0c82f8ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
describe "stronglifters::rails" do
  subject do
    ChefSpec::SoloRunner.new do |node|
      node.set["stronglifters"]["root_path"] = root_path
      node.set["stronglifters"]["username"] = username
      node.set["postgres"]["database"] = "app"
      node.set["postgres"]["username"] = username
      node.set["postgres"]["password"] = "password"
      node.set["postgres"]["host"] = "localhost"
      node.set["etc"]["passwd"][username]["dir"] = "/home/#{username}"
    end.converge(described_recipe)
  end
  let(:root_path) { "/var/www/#{FFaker::Internet.domain_name}"  }
  let(:shared_path) { File.join(root_path, "shared") }
  let(:username) { "deployer" }

  before :each do
    stub_command("stat -c %U #{root_path} | grep root").and_return(nil)
  end

  it "creates the sharec directory for the application" do
    expect(subject).to create_directory("#{shared_path}/config")
  end
end