Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add factory_bot lint test to core #3647

Merged
merged 1 commit into from Jun 4, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -8,6 +8,7 @@
store_credit
amount { 100.00 }
authorization_code { "#{store_credit.id}-SC-20140602164814476128" }
action { Spree::StoreCredit::AUTHORIZE_ACTION }

factory :store_credit_auth_event, class: 'Spree::StoreCreditEvent' do
action { Spree::StoreCredit::AUTHORIZE_ACTION }
Expand Down
Expand Up @@ -2,6 +2,8 @@

FactoryBot.define do
factory :store_credit_reason, class: 'Spree::StoreCreditReason' do
name { "Input error" }
sequence :name do |n|
"Input error #{n}"
end
end
end
9 changes: 9 additions & 0 deletions core/spec/lib/factory_spec.rb
@@ -0,0 +1,9 @@
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe "Factories" do
it "should pass linting" do
FactoryBot.lint(FactoryBot.factories.reject{ |f| f.name == :customer_return_without_return_items })
end
end