Make the application multi-tenant based on a wedding model #153

Merged
bustikiller merged 16 commits from wedding-model into main 2024-12-01 10:11:25 +00:00
7 changed files with 13 additions and 3 deletions
Showing only changes of commit 8429b3952b - Show all commits

View File

@ -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 }

View File

@ -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

View File

@ -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 }

View File

@ -0,0 +1,6 @@
FactoryBot.define do
factory :tables_arrangement do
wedding
end
end

View File

@ -2,6 +2,6 @@
FactoryBot.define do FactoryBot.define do
factory :user do factory :user do
wedding
end end
end end

View File

@ -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

View File

@ -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