[ARVADOS] updated: b9e29babf66aa33ea2188f80d517b11e5755e83a

Git user git at public.curoverse.com
Fri Sep 2 16:04:15 EDT 2016


Summary of changes:
 services/api/app/models/job.rb                          |  1 +
 services/api/test/factories/api_client.rb               |  2 +-
 services/api/test/factories/api_client_authorization.rb |  2 +-
 services/api/test/factories/user.rb                     | 10 ++++++----
 services/api/test/test_helper.rb                        |  1 +
 5 files changed, 10 insertions(+), 6 deletions(-)

       via  b9e29babf66aa33ea2188f80d517b11e5755e83a (commit)
      from  dfb8a488acce58b7dec6c3873964dc484f189b20 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit b9e29babf66aa33ea2188f80d517b11e5755e83a
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Sep 2 16:03:54 2016 -0400

    9931: Fix missing module. Remove global "include" in tests, so bugs like this can be caught in tests.
    
    refs #9931
    refs #9875

diff --git a/services/api/app/models/job.rb b/services/api/app/models/job.rb
index a86cc62..e7d1b39 100644
--- a/services/api/app/models/job.rb
+++ b/services/api/app/models/job.rb
@@ -2,6 +2,7 @@ class Job < ArvadosModel
   include HasUuid
   include KindAndEtag
   include CommonApiTemplate
+  extend CurrentApiClient
   serialize :components, Hash
   attr_protected :arvados_sdk_version, :docker_image_locator
   serialize :script_parameters, Hash
diff --git a/services/api/test/factories/api_client.rb b/services/api/test/factories/api_client.rb
index 7921c35..78c70fd 100644
--- a/services/api/test/factories/api_client.rb
+++ b/services/api/test/factories/api_client.rb
@@ -2,7 +2,7 @@ FactoryGirl.define do
   factory :api_client do
     is_trusted false
     to_create do |instance|
-      act_as_system_user do
+      CurrentApiClientHelper.act_as_system_user do
         instance.save!
       end
     end
diff --git a/services/api/test/factories/api_client_authorization.rb b/services/api/test/factories/api_client_authorization.rb
index 8bd569e..c388324 100644
--- a/services/api/test/factories/api_client_authorization.rb
+++ b/services/api/test/factories/api_client_authorization.rb
@@ -11,7 +11,7 @@ FactoryGirl.define do
     end
 
     to_create do |instance|
-      act_as_user instance.user do
+      CurrentApiClientHelper.act_as_user instance.user do
         instance.save!
       end
     end
diff --git a/services/api/test/factories/user.rb b/services/api/test/factories/user.rb
index 56e9125..6ec9e9f 100644
--- a/services/api/test/factories/user.rb
+++ b/services/api/test/factories/user.rb
@@ -1,4 +1,6 @@
-include CurrentApiClient
+class CurrentApiClientHelper
+  extend CurrentApiClient
+end
 
 FactoryGirl.define do
   factory :user do
@@ -6,7 +8,7 @@ FactoryGirl.define do
       join_groups []
     end
     after :create do |user, evaluator|
-      act_as_system_user do
+      CurrentApiClientHelper.act_as_system_user do
         evaluator.join_groups.each do |g|
           Link.create!(tail_uuid: user.uuid,
                        head_uuid: g.uuid,
@@ -27,7 +29,7 @@ FactoryGirl.define do
     factory :active_user do
       is_active true
       after :create do |user|
-        act_as_system_user do
+        CurrentApiClientHelper.act_as_system_user do
           Link.create!(tail_uuid: user.uuid,
                        head_uuid: Group.where('uuid ~ ?', '-f+$').first.uuid,
                        link_class: 'permission',
@@ -36,7 +38,7 @@ FactoryGirl.define do
       end
     end
     to_create do |instance|
-      act_as_system_user do
+      CurrentApiClientHelper.act_as_system_user do
         instance.save!
       end
     end
diff --git a/services/api/test/test_helper.rb b/services/api/test/test_helper.rb
index ef08c72..417ddf6 100644
--- a/services/api/test/test_helper.rb
+++ b/services/api/test/test_helper.rb
@@ -47,6 +47,7 @@ class ActiveSupport::TestCase
   fixtures :all
 
   include ArvadosTestSupport
+  include CurrentApiClient
 
   setup do
     Rails.logger.warn "\n\n#{'=' * 70}\n#{self.class}\##{method_name}\n#{'-' * 70}\n\n"

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list