FactoryGirl
Railsでhas_manyなテストするときー こんなのをテストしたい場合 RSpec.describe Address, :type => :model do describe 'Relation' do it 'has many customers' do expect(address.customers).to match_array customers end end end まずは、FactoryGirlで…
Railsでhas_manyなテストするときー こんなのをテストしたい場合 RSpec.describe Address, :type => :model do describe 'Relation' do it 'has many customers' do expect(address.customers).to match_array customers end end end まずは、FactoryGirlで…