2019-05-09 23:10:02 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-30 00:49:07 +08:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe Settings, type: :model do
|
2023-10-12 22:16:43 +08:00
|
|
|
let(:settings) { build(:settings) }
|
|
|
|
let(:application_settings) { build(:settings, :with_load_values_from_env_defined) }
|
|
|
|
|
|
|
|
it 'raises not NotImplementedError' do
|
|
|
|
expect { settings.load_values_from_env }.to raise_error(NotImplementedError)
|
|
|
|
end
|
|
|
|
|
2019-05-09 23:10:02 +08:00
|
|
|
|
|
|
|
it 'is valid' do
|
2023-10-12 22:16:43 +08:00
|
|
|
expect(application_settings).to be_valid
|
2019-05-09 23:10:02 +08:00
|
|
|
end
|
|
|
|
|
2017-08-30 00:49:07 +08:00
|
|
|
it 'should be of class Settings' do
|
2023-10-12 22:16:43 +08:00
|
|
|
expect(application_settings.class).to eq Settings
|
2017-08-30 00:49:07 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
describe 'Database table' do
|
|
|
|
it { should have_db_column :type }
|
|
|
|
it { should have_db_column :values }
|
|
|
|
end
|
|
|
|
end
|