You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
docuseal/spec/models/account_spec.rb

24 lines
693 B

# frozen_string_literal: true
require 'rails_helper'
RSpec.describe Account do
describe '#brand_name' do
let(:account) { create(:account) }
it 'returns nil when no brand_name AccountConfig is set' do
expect(account.brand_name).to be_nil
end
it 'returns the configured value' do
account.account_configs.create!(key: AccountConfig::BRAND_NAME_KEY, value: 'Acme Sign')
expect(account.brand_name).to eq('Acme Sign')
end
it 'strips surrounding whitespace from non-blank values' do
account.account_configs.create!(key: AccountConfig::BRAND_NAME_KEY, value: ' Acme Sign ')
expect(account.brand_name).to eq('Acme Sign')
end
end
end