mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 18:30:26 -06:00
5af7c90bab
We found score hard to understand. It is still there behind the scenes for sorting purposes, but it is no longer shown. You can now filter by minimum priority (low, med, high) instead of score.
22 lines
731 B
Ruby
22 lines
731 B
Ruby
require 'rails_helper'
|
|
|
|
describe Jobs::ReviewablePriorities do
|
|
|
|
it "will set priorities based on the maximum score" do
|
|
(1..6).each { |i| Fabricate(:reviewable, score: i) }
|
|
Jobs::ReviewablePriorities.new.execute({})
|
|
|
|
expect(Reviewable.min_score_for_priority('low')).to eq(0.0)
|
|
expect(Reviewable.min_score_for_priority('medium')).to eq(3.0)
|
|
expect(Reviewable.min_score_for_priority('high')).to eq(5.0)
|
|
end
|
|
|
|
it "will return 0 if no reviewables exist" do
|
|
Jobs::ReviewablePriorities.new.execute({})
|
|
|
|
expect(Reviewable.min_score_for_priority('low')).to eq(0.0)
|
|
expect(Reviewable.min_score_for_priority('medium')).to eq(0.0)
|
|
expect(Reviewable.min_score_for_priority('high')).to eq(0.0)
|
|
end
|
|
end
|