spec/cli/deploy_spec.rb in hanzo-0.4.3 vs spec/cli/deploy_spec.rb in hanzo-0.4.4
- old
+ new
@@ -6,11 +6,11 @@
let(:branch) { '1.0.0' }
let(:deploy!) { Hanzo::CLI.new(['deploy', env]) }
let(:heroku_remotes) { { 'production' => 'heroku-app-production' } }
let(:migration_dir) { 'db/migrate' }
- let(:migration_question) { 'Run migrations?' }
+ let(:migration_question) { 'Run database migrations?' }
let(:deploy_question) { "Branch to deploy in #{env}:" }
let(:migration_cmd) { "heroku run rake db:migrate --remote #{env}" }
let(:restart_cmd) { "heroku ps:restart --remote #{env}" }
let(:deploy_cmd) { "git push -f #{env} #{branch}:master" }
@@ -23,11 +23,11 @@
context 'successful deploy and without migrations' do
let(:migrations_exist) { false }
let(:deploy_result) { true }
before do
- expect(Dir).to receive(:exist?).with(migration_dir).and_return(migrations_exist)
+ expect(Dir).to receive(:exist?).with(instance_of(String)).at_least(:once).and_return(migrations_exist)
expect(Hanzo).to receive(:ask).with(deploy_question).and_return(branch)
expect(Hanzo).to receive(:run).with(deploy_cmd).once.and_return(deploy_result)
end
it 'should git push to heroku upstream' do
@@ -45,10 +45,10 @@
context 'with successful deploy' do
let(:deploy_result) { true }
before do
- expect(Dir).to receive(:exist?).with(migration_dir).and_return(migrations_exist)
+ expect(Dir).to receive(:exist?).with(instance_of(String)).at_least(:once).and_return(migrations_exist)
end
context 'and migrations that should be ran' do
before do
expect(Hanzo).to receive(:agree).with(migration_question).and_return(true)