aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
diff options
context:
space:
mode:
authorRafael Mendonça França <rafael.franca@plataformatec.com.br>2014-11-10 21:18:57 -0200
committerRafael Mendonça França <rafael.franca@plataformatec.com.br>2014-11-10 21:18:57 -0200
commit1d1239d32856b32b19c04edd17d0dd0d47611586 (patch)
tree5f232f5e7b4d938c64b467f769ee8e455f5cad6e /railties/test/application
parent091652cae8465711de3c12697a93c67a9f94576c (diff)
downloadrails-1d1239d32856b32b19c04edd17d0dd0d47611586.tar.gz
rails-1d1239d32856b32b19c04edd17d0dd0d47611586.tar.bz2
rails-1d1239d32856b32b19c04edd17d0dd0d47611586.zip
No need to sync config.secret_token and secrets.secret_token
Just prefer secrets over config
Diffstat (limited to 'railties/test/application')
-rw-r--r--railties/test/application/configuration_test.rb36
1 files changed, 2 insertions, 34 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb
index 55a3456cfc..922f387987 100644
--- a/railties/test/application/configuration_test.rb
+++ b/railties/test/application/configuration_test.rb
@@ -347,19 +347,17 @@ module ApplicationTests
end
end
- test "uses secrets.secret_token when secrets.secret_key_base and config.secret_token are blank" do
+ test "prefer secrets.secret_token over config.secret_token" do
app_file 'config/initializers/secret_token.rb', <<-RUBY
Rails.application.config.secret_token = ""
RUBY
app_file 'config/secrets.yml', <<-YAML
development:
- secret_key_base:
secret_token: 3b7cd727ee24e8444053437c36cc66c3
YAML
require "#{app_path}/config/environment"
assert_equal '3b7cd727ee24e8444053437c36cc66c3', app.secrets.secret_token
- assert_equal '3b7cd727ee24e8444053437c36cc66c3', app.config.secret_token
end
test "application verifier can build different verifiers" do
@@ -404,7 +402,7 @@ module ApplicationTests
test "config.secret_token over-writes a blank secrets.secret_token" do
app_file 'config/initializers/secret_token.rb', <<-RUBY
- Rails.application.config.secret_token = "b3c631c314c0bbca50c1b2843150fe33"
+ Rails.application.config.secret_token = "b3c631c314c0bbca50c1b2843150fe33"
RUBY
app_file 'config/secrets.yml', <<-YAML
development:
@@ -417,36 +415,6 @@ module ApplicationTests
assert_equal 'b3c631c314c0bbca50c1b2843150fe33', app.config.secret_token
end
- test "secret_token is copied from secrets to config when set" do
- app_file 'config/initializers/secret_token.rb', <<-RUBY
- Rails.application.config.secret_token = ""
- RUBY
- app_file 'config/secrets.yml', <<-YAML
- development:
- secret_key_base:
- secret_token: 3b7cd727ee24e8444053437c36cc66c3
- YAML
- require "#{app_path}/config/environment"
-
- assert_equal '3b7cd727ee24e8444053437c36cc66c3', app.secrets.secret_token
- assert_equal '3b7cd727ee24e8444053437c36cc66c3', app.config.secret_token
- end
-
- test "secret_token is copied from secrets to config when different" do
- app_file 'config/initializers/secret_token.rb', <<-RUBY
- Rails.application.config.secret_token = "b3c631c314c0bbca50c1b2843150fe33"
- RUBY
- app_file 'config/secrets.yml', <<-YAML
- development:
- secret_key_base:
- secret_token: 3b7cd727ee24e8444053437c36cc66c3
- YAML
- require "#{app_path}/config/environment"
-
- assert_equal '3b7cd727ee24e8444053437c36cc66c3', app.secrets.secret_token
- assert_equal '3b7cd727ee24e8444053437c36cc66c3', app.config.secret_token
- end
-
test "custom secrets saved in config/secrets.yml are loaded in app secrets" do
app_file 'config/secrets.yml', <<-YAML
development: