-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a test that lints FactoryBot. Also makes changes to two tests to conform to the lint - store_credit_event_factory needs to have an action, even if the action is replaced with one of the sub factories. store_credit_reason_factory tripped the linter because of a uniqueness contraint for the name - should not come up in normal testing, but I added a sequencer to account for it in the linter anyway. The linter ignores just one factory - customer_return_without_return_items this factory is intentionally invalid (see: /core/spec/lib/spree/core/testing_support/factories/customer_return_factory_spec.rb#L37 )
- Loading branch information
Showing
3 changed files
with
11 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
RSpec.describe FactoryBot do | ||
it { FactoryBot.lint(FactoryBot.factories.reject{ |f| f.name == :customer_return_without_return_items }) } | ||
end |