This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2023-02-21 16:55:31 -08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-02-21 10:50:12 -08:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2023-03-04 08:16:45 -08:00
|
|
|
describe Rule do
|
|
|
|
describe 'scopes' do
|
|
|
|
describe 'ordered' do
|
|
|
|
let(:deleted_rule) { Fabricate(:rule, deleted_at: 10.days.ago) }
|
|
|
|
let(:first_rule) { Fabricate(:rule, deleted_at: nil, priority: 1) }
|
|
|
|
let(:last_rule) { Fabricate(:rule, deleted_at: nil, priority: 10) }
|
|
|
|
|
|
|
|
it 'finds the correct records' do
|
|
|
|
results = described_class.ordered
|
|
|
|
|
|
|
|
expect(results).to eq([first_rule, last_rule])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2021-02-21 10:50:12 -08:00
|
|
|
end
|