Refactor factory_bot_spec.rb to conform to Let's Not style (#1352)

This commit is contained in:
Richie Thomas 2019-10-23 12:53:22 -07:00 committed by GitHub
parent 686b6cb9d9
commit 16dd032885
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -1,19 +1,19 @@
describe FactoryBot do
let(:factory) { FactoryBot::Factory.new(:object) }
let(:sequence) { FactoryBot::Sequence.new(:email) }
let(:trait) { FactoryBot::Trait.new(:admin) }
it "finds a registered factory", :silence_deprecation do
factory = FactoryBot::Factory.new(:object)
FactoryBot.register_factory(factory)
expect(FactoryBot.factory_by_name(factory.name)).to eq factory
end
it "finds a registered sequence", :silence_deprecation do
sequence = FactoryBot::Sequence.new(:email)
FactoryBot.register_sequence(sequence)
expect(FactoryBot.sequence_by_name(sequence.name)).to eq sequence
end
it "finds a registered trait", :silence_deprecation do
trait = FactoryBot::Trait.new(:admin)
FactoryBot.register_trait(trait)
expect(FactoryBot.trait_by_name(trait.name)).to eq trait
end