namespace_spec.rb 544 B

12345678910111213141516171819202122232425
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe UserSettings::Namespace do
  4. subject { described_class.new(name) }
  5. let(:name) { :foo }
  6. describe '#setting' do
  7. before do
  8. subject.setting :bar, default: 'baz'
  9. end
  10. it 'adds setting to definitions' do
  11. expect(subject.definitions[:'foo.bar']).to have_attributes(name: :bar, namespace: :foo, default_value: 'baz')
  12. end
  13. end
  14. describe '#definitions' do
  15. it 'returns a hash' do
  16. expect(subject.definitions).to be_a Hash
  17. end
  18. end
  19. end