Commit 06d5c8c65f8d0611f7342dd448d3887d074efd07
1 parent
11eaf495
Exists in
master
and in
29 other branches
stoa-plugin-tests: fixes config.yml loading path
Appending with Pathname#+ caused the File.open to search for the config file in '/config.yml' instead of StoaPlugin.root_path/config.yml, throwing a "No such file or directory" error. This patch fixes that error.
Showing
4 changed files
with
4 additions
and
4 deletions
Show diff stats
plugins/stoa/lib/stoa_plugin/usp_user.rb
... | ... | @@ -3,7 +3,7 @@ class StoaPlugin::UspUser < ActiveRecord::Base |
3 | 3 | establish_connection(:stoa) |
4 | 4 | set_table_name('pessoa') |
5 | 5 | |
6 | - SALT=YAML::load(File.open(StoaPlugin.root_path + '/config.yml'))['salt'] | |
6 | + SALT=YAML::load(File.open(StoaPlugin.root_path + 'config.yml'))['salt'] | |
7 | 7 | |
8 | 8 | alias_attribute :cpf, :numcpf |
9 | 9 | alias_attribute :birth_date, :dtanas | ... | ... |
plugins/stoa/test/functional/account_controller_test.rb
... | ... | @@ -6,7 +6,7 @@ class AccountController; def rescue_action(e) raise e end; end |
6 | 6 | |
7 | 7 | class AccountControllerTest < ActionController::TestCase |
8 | 8 | |
9 | - SALT=YAML::load(File.open(StoaPlugin.root_path + '/config.yml'))['salt'] | |
9 | + SALT=YAML::load(File.open(StoaPlugin.root_path + 'config.yml'))['salt'] | |
10 | 10 | |
11 | 11 | def setup |
12 | 12 | @controller = AccountController.new | ... | ... |
plugins/stoa/test/functional/profile_editor_controller_test.rb
... | ... | @@ -6,7 +6,7 @@ class ProfileEditorController; def rescue_action(e) raise e end; end |
6 | 6 | |
7 | 7 | class StoaPluginProfileEditorControllerTest < ActionController::TestCase |
8 | 8 | |
9 | - SALT=YAML::load(File.open(StoaPlugin.root_path + '/config.yml'))['salt'] | |
9 | + SALT=YAML::load(File.open(StoaPlugin.root_path + 'config.yml'))['salt'] | |
10 | 10 | |
11 | 11 | def setup |
12 | 12 | @controller = ProfileEditorController.new | ... | ... |
plugins/stoa/test/unit/usp_user_test.rb
... | ... | @@ -2,7 +2,7 @@ require File.dirname(__FILE__) + '/../../../../test/test_helper' |
2 | 2 | |
3 | 3 | class StoaPlugin::UspUserTest < ActiveSupport::TestCase |
4 | 4 | |
5 | - SALT=YAML::load(File.open(StoaPlugin.root_path + '/config.yml'))['salt'] | |
5 | + SALT=YAML::load(File.open(StoaPlugin.root_path + 'config.yml'))['salt'] | |
6 | 6 | |
7 | 7 | def setup |
8 | 8 | @db = Tempfile.new('stoa-test') | ... | ... |