Commit 06d5c8c65f8d0611f7342dd448d3887d074efd07

Authored by Larissa Reis
1 parent 11eaf495

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.
plugins/stoa/lib/stoa_plugin/usp_user.rb
@@ -3,7 +3,7 @@ class StoaPlugin::UspUser < ActiveRecord::Base @@ -3,7 +3,7 @@ class StoaPlugin::UspUser < ActiveRecord::Base
3 establish_connection(:stoa) 3 establish_connection(:stoa)
4 set_table_name('pessoa') 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 alias_attribute :cpf, :numcpf 8 alias_attribute :cpf, :numcpf
9 alias_attribute :birth_date, :dtanas 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,7 +6,7 @@ class AccountController; def rescue_action(e) raise e end; end
6 6
7 class AccountControllerTest < ActionController::TestCase 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 def setup 11 def setup
12 @controller = AccountController.new 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,7 +6,7 @@ class ProfileEditorController; def rescue_action(e) raise e end; end
6 6
7 class StoaPluginProfileEditorControllerTest < ActionController::TestCase 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 def setup 11 def setup
12 @controller = ProfileEditorController.new 12 @controller = ProfileEditorController.new
plugins/stoa/test/unit/usp_user_test.rb
@@ -2,7 +2,7 @@ require File.dirname(__FILE__) + &#39;/../../../../test/test_helper&#39; @@ -2,7 +2,7 @@ require File.dirname(__FILE__) + &#39;/../../../../test/test_helper&#39;
2 2
3 class StoaPlugin::UspUserTest < ActiveSupport::TestCase 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 def setup 7 def setup
8 @db = Tempfile.new('stoa-test') 8 @db = Tempfile.new('stoa-test')