account_warning_preset_spec.rb 540 B

1234567891011121314151617
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe AccountWarningPreset do
  4. describe 'alphabetical' do
  5. let(:first) { Fabricate(:account_warning_preset, title: 'aaa', text: 'aaa') }
  6. let(:second) { Fabricate(:account_warning_preset, title: 'bbb', text: 'aaa') }
  7. let(:third) { Fabricate(:account_warning_preset, title: 'bbb', text: 'bbb') }
  8. it 'returns records in order of title and text' do
  9. results = described_class.alphabetic
  10. expect(results).to eq([first, second, third])
  11. end
  12. end
  13. end