Skip to content

Commit

Permalink
Merge pull request #3647 from seand7565/add_factory_bot_linting
Browse files Browse the repository at this point in the history
Add factory_bot lint test to core
  • Loading branch information
aldesantis authored Jun 4, 2020
2 parents 6ad7e95 + 92a5e3b commit 9c1d843
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9c1d843

Please sign in to comment.