mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 19:27:52 +01:00
Move tenant settings on separate model (#196)
This commit is contained in:
committed by
GitHub
parent
6c03a0d750
commit
d4242dd78e
6
spec/factories/tenant_settings.rb
Normal file
6
spec/factories/tenant_settings.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
FactoryBot.define do
|
||||
factory :tenant_setting do
|
||||
brand_display { 0 }
|
||||
tenant
|
||||
end
|
||||
end
|
||||
22
spec/models/tenant_setting_spec.rb
Normal file
22
spec/models/tenant_setting_spec.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe TenantSetting, type: :model do
|
||||
let(:tenant_setting) { FactoryBot.build(:tenant_setting) }
|
||||
|
||||
it 'should be valid' do
|
||||
expect(tenant_setting).to be_valid
|
||||
end
|
||||
|
||||
it 'has a setting brand_display' do
|
||||
expect(tenant_setting.brand_display).to eq('name_and_logo')
|
||||
|
||||
tenant_setting.brand_display = 'name_only'
|
||||
expect(tenant_setting).to be_valid
|
||||
|
||||
tenant_setting.brand_display = 'logo_only'
|
||||
expect(tenant_setting).to be_valid
|
||||
|
||||
tenant_setting.brand_display = 'no_name_no_logo'
|
||||
expect(tenant_setting).to be_valid
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user