Adapt factories to use a wedding object
This commit is contained in:
parent
e4dad698ea
commit
8429b3952b
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
FactoryBot.define do
|
FactoryBot.define do
|
||||||
factory :expense do
|
factory :expense do
|
||||||
|
wedding
|
||||||
sequence(:name) { |i| "Expense #{i}" }
|
sequence(:name) { |i| "Expense #{i}" }
|
||||||
pricing_type { "fixed" }
|
pricing_type { "fixed" }
|
||||||
amount { 100 }
|
amount { 100 }
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
FactoryBot.define do
|
FactoryBot.define do
|
||||||
factory :group do
|
factory :group do
|
||||||
|
wedding
|
||||||
sequence(:name) { |i| "Group #{i}" }
|
sequence(:name) { |i| "Group #{i}" }
|
||||||
order { 1 }
|
order { 1 }
|
||||||
end
|
end
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
FactoryBot.define do
|
FactoryBot.define do
|
||||||
factory :guest do
|
factory :guest do
|
||||||
association :group
|
group
|
||||||
|
wedding
|
||||||
|
|
||||||
name { Faker::Name.name }
|
name { Faker::Name.name }
|
||||||
phone { Faker::PhoneNumber.cell_phone }
|
phone { Faker::PhoneNumber.cell_phone }
|
||||||
|
6
spec/factories/table_arrangement.rb
Normal file
6
spec/factories/table_arrangement.rb
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FactoryBot.define do
|
||||||
|
factory :tables_arrangement do
|
||||||
|
wedding
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
FactoryBot.define do
|
FactoryBot.define do
|
||||||
factory :user do
|
factory :user do
|
||||||
|
wedding
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
FactoryBot.define do
|
FactoryBot.define do
|
||||||
factory :wedding do
|
factory :wedding do
|
||||||
|
sequence(:slug) { |i| "wedding-#{i}" }
|
||||||
date { 1.year.from_now }
|
date { 1.year.from_now }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -5,7 +5,7 @@ require 'rails_helper'
|
|||||||
RSpec.describe TablesArrangement, type: :model do
|
RSpec.describe TablesArrangement, type: :model do
|
||||||
describe 'callbacks' do
|
describe 'callbacks' do
|
||||||
it 'assigns a name before creation' do
|
it 'assigns a name before creation' do
|
||||||
expect(described_class.create!.name).to be_present
|
expect(create(:tables_arrangement).name).to be_present
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user