Last active
December 21, 2018 00:31
-
-
Save veganstraightedge/c39efb0521e09fd0798a3e0323102732 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
DEPRECATION WARNING: Static attributes will be removed in FactoryBot 5.0. Please use dynamic | |
attributes instead by wrapping the attribute value in a block: | |
alias { "orders" } | |
To automatically update from static attributes to dynamic ones, | |
install rubocop-rspec and run: | |
rubocop --require rubocop-rspec \ | |
--only FactoryBot/AttributeDefinedStatically \ | |
--auto-correct | |
(called from block (3 levels) in <top (required)> at .../spec/factories/foo_factory.rb:6) |
This file contains hidden or 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
FactoryBot.define do | |
factory :foo do | |
trait :from_orders do | |
type { 'FROM' } | |
attrs { {} } | |
add_attribute :alias, 'orders' | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment