Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Verify production is used in staging

  • Loading branch information...
commit 3b525e099173c4a3a8c1d86320d2e610652e460e 1 parent 258f7a6
@croaky croaky authored
View
12 lib/suspenders/app_builder.rb
@@ -84,7 +84,17 @@ def enable_rack_deflater
end
def setup_staging_environment
- copy_file 'staging.rb', 'config/environments/staging.rb'
+ staging_file = 'config/environments/staging.rb'
+ copy_file 'staging.rb', staging_file
+
+ config = <<-RUBY
+
+#{app_name.classify}::Application.configure do
+ # ...
+end
+ RUBY
+
+ append_file staging_file, config
end
def setup_secret_token
View
4 spec/features/github_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'
-feature 'Github' do
- scenario 'Suspend a project with github option' do
+feature 'GitHub' do
+ scenario 'Suspend a project with --github option' do
repo_name = 'test'
run_suspenders("--github=#{repo_name}")
View
6 spec/features/new_project_spec.rb
@@ -14,8 +14,10 @@
scenario 'staging config is inherited from production' do
run_suspenders
- staging_file = "#{project_path}/config/environments/staging.rb"
+ staging_file = IO.read("#{project_path}/config/environments/staging.rb")
+ config_stub = "Dummy::Application.configure do"
- expect(IO.read(staging_file)).to eq template('staging.rb')
+ expect(staging_file).to match(/^require_relative 'production'/)
+ expect(staging_file).to match(/#{config_stub}/), staging_file
end
end
View
4 spec/support/suspenders.rb
@@ -30,10 +30,6 @@ def drop_dummy_database
end
end
- def template(file)
- IO.read("#{root_path}/templates/#{file}")
- end
-
def project_path
@project_path ||= Pathname.new("#{tmp_path}/#{APP_NAME}")
end
Please sign in to comment.
Something went wrong with that request. Please try again.