1
0

extended_description_spec.rb 760 B

1234567891011121314151617181920212223242526272829
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe ExtendedDescription do
  4. describe '.current' do
  5. context 'with the default values' do
  6. it 'makes a new instance' do
  7. record = described_class.current
  8. expect(record.text).to be_nil
  9. expect(record.updated_at).to be_nil
  10. end
  11. end
  12. context 'with a custom setting value' do
  13. before do
  14. setting = instance_double(Setting, value: 'Extended text', updated_at: 10.days.ago)
  15. allow(Setting).to receive(:find_by).with(var: 'site_extended_description').and_return(setting)
  16. end
  17. it 'has the privacy text' do
  18. record = described_class.current
  19. expect(record.text).to eq('Extended text')
  20. end
  21. end
  22. end
  23. end