How to generate multiple data of the same model in Rspec model test
factories/tweets.rb
FactoryBot.define do
factory :tweet_1,class: Tweet do
text {"Good morning"}
end
factory :tweet_2,class: Tweet do
text {"Hello"}
end
factory :tweet_3,class: Tweet do
text {"Good evening"}
end
end
spec/models/tweets_spec.rb
let(:tweet_a) { create(:tweet_1) }
let(:tweet_b) { create(:tweet_2) }
let(:tweet_c) { create(:tweet_3) }