Skip to content
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
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,6 @@ Metrics/PerceivedComplexity:

Bundler/OrderedGems:
Enabled: false

Style/NumericLiterals:
Enabled: false
1 change: 0 additions & 1 deletion api/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
DummyApp::Migrations.auto_migrate

require 'rspec/rails'
require 'ffaker'

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Expand Down
1 change: 0 additions & 1 deletion backend/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }

require 'database_cleaner'
require 'ffaker'
require 'with_model'

require 'spree/testing_support/authorization_helpers'
Expand Down
1 change: 0 additions & 1 deletion common_spree_dependencies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
gem 'with_model'
gem 'rspec_junit_formatter'
gem 'rails-controller-testing'
gem 'ffaker', require: false
gem 'selenium-webdriver'
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
address1 '10 Lovely Street'
address2 'Northwest'
city 'Herndon'
zipcode { FFaker::AddressUS.zip_code }
sequence(:zipcode, 10001) { |i| i.to_s }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use underscores(_) as decimal mark and separate every 3 digits with them.

Copy link
Copy Markdown
Contributor Author

@jhawthorn jhawthorn Oct 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no 😠

I have disabled this rule.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌🏼

phone '555-555-0199'
alternative_phone '555-555-0199'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
FactoryBot.define do
factory :promotion_code, class: 'Spree::PromotionCode' do
promotion
value { generate(:random_code) }
sequence(:value) { |i| "code#{i}" }
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
factory :tax_category, class: 'Spree::TaxCategory' do
name { "TaxCategory - #{rand(999_999)}" }
tax_code { "TaxCode - #{rand(999_999)}" }
description { generate(:random_string) }
end
end
2 changes: 1 addition & 1 deletion core/lib/spree/testing_support/factories/user_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
end

factory :user, class: Spree.user_class do
email { generate(:random_email) }
email { generate(:email) }
login { email } if Spree.user_class.attribute_method? :login
password 'secret'
password_confirmation { password } if Spree.user_class.attribute_method? :password_confirmation
Expand Down
4 changes: 1 addition & 3 deletions core/lib/spree/testing_support/factories/zone_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
FactoryBot.define do
factory :global_zone, class: 'Spree::Zone' do
name 'GlobalZone'
description { generate(:random_string) }
zone_members do |proxy|
zone = proxy.instance_eval { @instance }
Spree::Country.all.map do |c|
Expand All @@ -14,8 +13,7 @@
end

factory :zone, class: 'Spree::Zone' do
name { generate(:random_string) }
description { generate(:random_string) }
sequence(:name) { |i| "Zone #{i}" }

trait :with_country do
countries { [create(:country)] }
Expand Down
11 changes: 1 addition & 10 deletions core/lib/spree/testing_support/sequences.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
require 'factory_bot'

begin
require 'ffaker'
rescue LoadError
abort "Solidus factories require FFaker. Please add `ffaker` to your `Gemfile`."
end

FactoryBot.define do
sequence(:random_code) { FFaker::Lorem.characters(10) }
sequence(:random_description) { FFaker::Lorem.paragraphs(1 + Kernel.rand(5)).join("\n") }
sequence(:random_email) { FFaker::Internet.email }
sequence(:random_string) { FFaker::Lorem.sentence }
sequence(:sku) { |n| "SKU-#{n}" }
sequence(:email) { |n| "email#{n}@example.com" }
end
2 changes: 0 additions & 2 deletions core/spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

Dir["./spec/support/**/*.rb"].sort.each { |f| require f }

require 'ffaker'

if ENV["CHECK_TRANSLATIONS"]
require "spree/testing_support/i18n"
end
Expand Down
1 change: 0 additions & 1 deletion frontend/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
DummyApp::Migrations.auto_migrate

require 'rspec/rails'
require 'ffaker'

# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Expand Down
1 change: 0 additions & 1 deletion sample/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
DummyApp::Migrations.auto_migrate

require 'rspec/rails'
require 'ffaker'

RSpec.configure do |config|
config.color = true
Expand Down