summaryrefslogtreecommitdiff
path: root/test/support
diff options
context:
space:
mode:
Diffstat (limited to 'test/support')
-rw-r--r--test/support/api_integration_test.rb2
-rw-r--r--test/support/auth_test_helper.rb5
-rw-r--r--test/support/browser_integration_test.rb2
-rw-r--r--test/support/stub_record_helper.rb4
4 files changed, 6 insertions, 7 deletions
diff --git a/test/support/api_integration_test.rb b/test/support/api_integration_test.rb
index 7942558..94c88e1 100644
--- a/test/support/api_integration_test.rb
+++ b/test/support/api_integration_test.rb
@@ -22,7 +22,7 @@ class ApiIntegrationTest < ActionDispatch::IntegrationTest
@testcode = InviteCode.new
@testcode.save!
options.reverse_merge! invite_code: @testcode.invite_code
- FactoryGirl.create :user, options
+ FactoryBot.create :user, options
end
teardown do
diff --git a/test/support/auth_test_helper.rb b/test/support/auth_test_helper.rb
index acc6076..df008e5 100644
--- a/test/support/auth_test_helper.rb
+++ b/test/support/auth_test_helper.rb
@@ -53,9 +53,8 @@ module AuthTestHelper
end
def expect_warden_logout
- raw = mock('raw session') do
- expects(:inspect)
- end
+ raw = mock('raw session')
+ raw.expects(:inspect)
request.env['warden'].expects(:raw_session).returns(raw)
request.env['warden'].expects(:logout)
end
diff --git a/test/support/browser_integration_test.rb b/test/support/browser_integration_test.rb
index d00e606..cff732b 100644
--- a/test/support/browser_integration_test.rb
+++ b/test/support/browser_integration_test.rb
@@ -49,7 +49,7 @@ class BrowserIntegrationTest < RackStackTest
# ApiIntegrationTest has a working implementation for RackTest
def login(user = nil)
InviteCodeValidator.any_instance.stubs(:validate)
- @user ||= user ||= FactoryGirl.create(:user)
+ @user ||= user ||= FactoryBot.create(:user)
token = Token.create user_id: user.id
page.driver.add_header "Authorization", %Q(Token token="#{token}")
visit '/'
diff --git a/test/support/stub_record_helper.rb b/test/support/stub_record_helper.rb
index 25138a0..4d74f2a 100644
--- a/test/support/stub_record_helper.rb
+++ b/test/support/stub_record_helper.rb
@@ -26,7 +26,7 @@ module StubRecordHelper
if record_or_method_hash && !record_or_method_hash.is_a?(Hash)
return record_or_method_hash
end
- FactoryGirl.build_stubbed(factory).tap do |record|
+ FactoryBot.build_stubbed(factory).tap do |record|
if persisted or record.persisted?
record_or_method_hash.reverse_merge! :created_at => Time.now,
:updated_at => Time.now, :id => Random.rand(100000).to_s
@@ -38,7 +38,7 @@ module StubRecordHelper
# returns deep stringified attributes so they can be compared to
# what the controller receives as params
def record_attributes_for(factory, attribs_hash = nil)
- FactoryGirl.attributes_for(factory, attribs_hash).tap do |attribs|
+ FactoryBot.attributes_for(factory, attribs_hash).tap do |attribs|
attribs.keys.each do |key|
val = attribs.delete(key)
attribs[key.to_s] = val.is_a?(Hash) ? val.stringify_keys! : val