Skip to content
This repository was archived by the owner on Apr 14, 2023. It is now read-only.

Follow the factory_bot rename #131

Merged
merged 1 commit into from
Oct 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/solidus_paypal_braintree/factories.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FactoryGirl.define do
FactoryBot.define do
# Define your Spree extensions Factories within this file to enable applications, and other extensions to use and override them.
#
# Example adding this to your spec_helper will load these Factories for use:
# require 'solidus_paypal_braintree/factories'
end

FactoryGirl.modify do
FactoryBot.modify do
# The Solidus address factory randomizes the zipcode.
# The OrderWalkThrough we use in the credit card checkout spec uses this factory for the user addresses.
# For credit card payments we transmit the billing address to braintree, for paypal payments the shipping address.
Expand Down
2 changes: 1 addition & 1 deletion solidus_paypal_braintree.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'coffee-rails'
s.add_development_dependency 'sass-rails'
s.add_development_dependency 'database_cleaner'
s.add_development_dependency 'factory_girl'
s.add_development_dependency 'factory_bot'
s.add_development_dependency 'rspec-rails'
s.add_development_dependency 'rubocop', '>= 0.47'
s.add_development_dependency 'rubocop-rspec'
Expand Down
14 changes: 7 additions & 7 deletions spec/models/solidus_paypal_braintree/gateway_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,10 @@
end

shared_examples "sources_by_order" do
let(:order) { FactoryGirl.create :order, user: user, state: "complete", completed_at: Time.current }
let(:order) { FactoryBot.create :order, user: user, state: "complete", completed_at: Time.current }
let(:gateway) { new_gateway.tap(&:save!) }

let(:other_payment_method) { FactoryGirl.create(:payment_method) }
let(:other_payment_method) { FactoryBot.create(:payment_method) }

let(:source_without_profile) do
SolidusPaypalBraintree::Source.create!(
Expand All @@ -429,7 +429,7 @@
end
end

let!(:source_payment) { FactoryGirl.create(:payment, order: order, payment_method_id: payment_method_id, source: source) }
let!(:source_payment) { FactoryBot.create(:payment, order: order, payment_method_id: payment_method_id, source: source) }

context "when the order has payments with the braintree payment method" do
let(:payment_method_id) { gateway.id }
Expand All @@ -453,7 +453,7 @@

context "when the order has no payments with the braintree payment method" do
let(:payment_method_id) { other_payment_method.id }
let(:source) { FactoryGirl.create :credit_card }
let(:source) { FactoryBot.create :credit_card }

it "returns no results" do
expect(subject.to_a).to eql([])
Expand All @@ -463,15 +463,15 @@

describe "#sources_by_order" do
let(:gateway) { new_gateway.tap(&:save!) }
let(:order) { FactoryGirl.create :order, user: user, state: "complete", completed_at: Time.current }
let(:order) { FactoryBot.create :order, user: user, state: "complete", completed_at: Time.current }

subject { gateway.sources_by_order(order) }

include_examples "sources_by_order"
end

describe "#reusable_sources" do
let(:order) { FactoryGirl.build :order, user: user }
let(:order) { FactoryBot.build :order, user: user }
let(:gateway) { new_gateway.tap(&:save!) }

subject { gateway.reusable_sources(order) }
Expand All @@ -482,7 +482,7 @@

context "when an order is not completed" do
context "when the order has a user id" do
let(:user) { FactoryGirl.create(:user) }
let(:user) { FactoryBot.create(:user) }

let!(:source_without_profile) do
SolidusPaypalBraintree::Source.create!(
Expand Down