spec/jumpup/heroku/configuration_spec.rb in jumpup-heroku-0.0.2 vs spec/jumpup/heroku/configuration_spec.rb in jumpup-heroku-0.0.3
- old
+ new
@@ -41,53 +41,52 @@
describe "with multiple accounts" do
context "first account" do
before { ENV.stub(:[]).with("HEROKU_ACCOUNT").and_return("first") }
before do
Jumpup::Heroku.configure do |config|
+ config.app = 'myapp'
config.run_database_tasks = false
config.account(:first) do |first|
- first.app = 'myapp1'
first.production_app = 'myapp1-production'
first.staging_app = 'myapp1-staging'
end
config.account(:second) do |second|
- second.app = 'myapp2'
second.production_app = 'myapp2-production'
second.staging_app = 'myapp2-staging'
end
end
end
subject do
Jumpup::Heroku.configuration
end
- its(:app) { should eq('myapp1') }
+ its(:valid?) { should be_true }
+ its(:app) { should be_nil }
its(:staging_app) { should eq('myapp1-staging')}
its(:production_app) { should eq('myapp1-production') }
its(:run_database_tasks) { should be_false }
its(:host) { should eq('heroku.first') }
end
context "second account with default values" do
before { ENV.stub(:[]).with("HEROKU_ACCOUNT").and_return("second") }
before do
Jumpup::Heroku.configure do |config|
- config.app = 'myapp1'
config.production_app = 'myapp1-production'
config.staging_app = 'myapp1-staging'
config.run_database_tasks = true
config.account(:second) do |second|
- second.app = 'myapp2'
second.production_app = 'myapp2-production'
second.staging_app = 'myapp2-staging'
second.run_database_tasks = false
second.host = 'mysecondhost.com'
end
end
end
subject do
Jumpup::Heroku.configuration
end
- its(:app) { should eq('myapp2') }
+ its(:valid?) { should be_true }
+ its(:app) { should be_nil }
its(:staging_app) { should eq('myapp2-staging')}
its(:production_app) { should eq('myapp2-production') }
its(:run_database_tasks) { should be_false }
its(:host) { should eq('mysecondhost.com') }
end
@@ -109,10 +108,11 @@
end
end
subject do
Jumpup::Heroku.configuration
end
+ its(:valid?) { should be_false }
its(:app) { should be_nil }
its(:staging_app) { should be_nil }
its(:production_app) { should be_nil }
its(:run_database_tasks) { should be_false }
its(:host) { should eq('heroku.com') }
@@ -130,35 +130,35 @@
end
end
subject do
Jumpup::Heroku.configuration
end
+ its(:valid?) { should be_false }
its(:app) { should be_nil }
its(:staging_app) { should be_nil }
its(:production_app) { should be_nil }
its(:run_database_tasks) { should be_true }
its(:host) { should eq('heroku.com') }
end
context "without herou accounts installed and default values" do
before { Jumpup::Heroku::Configuration.any_instance.stub(:current_account).and_return(:"") }
before do
Jumpup::Heroku.configure do |config|
- config.app = 'myapp1'
config.production_app = 'myapp1-production'
config.staging_app = 'myapp1-staging'
config.run_database_tasks = true
config.account(:second) do |second|
- second.app = 'myapp2'
second.production_app = 'myapp2-production'
second.staging_app = 'myapp2-staging'
config.run_database_tasks = false
end
end
end
subject do
Jumpup::Heroku.configuration
end
- its(:app) { should eq('myapp1') }
+ its(:valid?) { should be_true }
+ its(:app) { should be_nil }
its(:staging_app) { should eq('myapp1-staging')}
its(:production_app) { should eq('myapp1-production') }
its(:run_database_tasks) { should be_true }
end
end