14274: Fix FactoryGirl deprication warning (renamed to FactoryBot)
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Tue, 2 Oct 2018 17:56:16 +0000 (13:56 -0400)
committerPeter Amstutz <pamstutz@veritasgenetics.com>
Wed, 3 Oct 2018 17:31:14 +0000 (13:31 -0400)
Also fix "mocha/mini_test" -> "mocha/minitest" warning.

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz@veritasgenetics.com>

services/api/Gemfile
services/api/Gemfile.lock
services/api/test/factories/api_client.rb
services/api/test/factories/api_client_authorization.rb
services/api/test/factories/group.rb
services/api/test/factories/link.rb
services/api/test/factories/user.rb
services/api/test/test_helper.rb

index 0dc38f1e726f2e1dfbf0f1645c389f964920ee14..5cf854b52072e0ecbdf5780d3973dcee7b485b61 100644 (file)
@@ -9,7 +9,7 @@ gem 'responders', '~> 2.0'
 gem 'protected_attributes'
 
 group :test, :development do
-  gem 'factory_girl_rails'
+  gem 'factory_bot_rails'
   gem 'database_cleaner'
   gem 'ruby-prof'
   # Note: "require: false" here tells bunder not to automatically
index f935f2c0723a64a99bce17cef26679862931672e..3cf79b2d8f32d73064e27c2d831f5f6dde6baafd 100644 (file)
@@ -93,10 +93,10 @@ GEM
     eventmachine (1.2.6)
     execjs (2.7.0)
     extlib (0.9.16)
-    factory_girl (4.9.0)
+    factory_bot (4.11.1)
       activesupport (>= 3.0.0)
-    factory_girl_rails (4.9.0)
-      factory_girl (~> 4.9.0)
+    factory_bot_rails (4.11.1)
+      factory_bot (~> 4.11.1)
       railties (>= 3.0.0)
     faraday (0.12.2)
       multipart-post (>= 1.2, < 3)
@@ -294,7 +294,7 @@ DEPENDENCIES
   arvados-cli
   coffee-rails (~> 4.0)
   database_cleaner
-  factory_girl_rails
+  factory_bot_rails
   faye-websocket
   httpclient
   jquery-rails
index 55f795702ac0b00df5476e079554f9fbcf019409..ee2017bf72f8553f406120c40cdd5f174dfedb26 100644 (file)
@@ -2,9 +2,9 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
-FactoryGirl.define do
+FactoryBot.define do
   factory :api_client do
-    is_trusted false
+    is_trusted { false }
     to_create do |instance|
       CurrentApiClientHelper.act_as_system_user do
         instance.save!
index f5e3ab4ccb1f17537f6d4f3075a791555861bdab..af2660a5ff816df9121a83326a3cafd5e440c2c7 100644 (file)
@@ -2,10 +2,10 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
-FactoryGirl.define do
+FactoryBot.define do
   factory :api_client_authorization do
     api_client
-    scopes ['all']
+    scopes { ['all'] }
 
     trait :trusted do
       association :api_client, factory: :api_client, is_trusted: true
index dcff783185839c7384e93432edf15359c0961362..7af57354b7eefa1c035b02768872cb2a5fec4d04 100644 (file)
@@ -2,7 +2,7 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
-FactoryGirl.define do
+FactoryBot.define do
   factory :group do
   end
 end
index 00f463d37008c105f0ceb4f919f00a1cfdcfe5bd..291a04e0c78a63f5882b3b8991e86ea15aea8863 100644 (file)
@@ -2,10 +2,10 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
-FactoryGirl.define do
+FactoryBot.define do
   factory :link do
     factory :permission_link do
-      link_class 'permission'
+      link_class { 'permission' }
     end
   end
 end
index 344e571ef70bc12f3fbf331ef89c7170490b485c..91d939516485328ba492717b55d60ba9de216793 100644 (file)
@@ -6,10 +6,10 @@ class CurrentApiClientHelper
   extend CurrentApiClient
 end
 
-FactoryGirl.define do
+FactoryBot.define do
   factory :user do
     transient do
-      join_groups []
+      join_groups { [] }
     end
     after :create do |user, evaluator|
       CurrentApiClientHelper.act_as_system_user do
@@ -25,13 +25,13 @@ FactoryGirl.define do
         end
       end
     end
-    first_name "Factory"
-    last_name "Factory"
+    first_name { "Factory" }
+    last_name { "Factory" }
     identity_url do
       "https://example.com/#{rand(2**24).to_s(36)}"
     end
     factory :active_user do
-      is_active true
+      is_active { true }
       after :create do |user|
         CurrentApiClientHelper.act_as_system_user do
           Link.create!(tail_uuid: user.uuid,
index 73b45f95ec71a7b28564c8a5767eb48503ec5465..40e801e013ab39d047c1e027693d0a00721a2b12 100644 (file)
@@ -33,7 +33,7 @@ end
 require File.expand_path('../../config/environment', __FILE__)
 require 'rails/test_help'
 require 'mocha'
-require 'mocha/mini_test'
+require 'mocha/minitest'
 
 module ArvadosTestSupport
   def json_response
@@ -54,7 +54,7 @@ module ArvadosTestSupport
 end
 
 class ActiveSupport::TestCase
-  include FactoryGirl::Syntax::Methods
+  include FactoryBot::Syntax::Methods
   fixtures :all
 
   include ArvadosTestSupport