mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 21:01:04 +08:00
DEV: Fix lint and flaky summarization spec (#22303)
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
describe Summarization::Base do
|
||||
subject(:summarization) { described_class.new }
|
||||
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
fab!(:group) { Fabricate(:group) }
|
||||
|
||||
@ -10,13 +12,13 @@ describe Summarization::Base do
|
||||
it "returns true if the user group is present in the custom_summarization_allowed_groups_map setting" do
|
||||
SiteSetting.custom_summarization_allowed_groups = group.id
|
||||
|
||||
expect(subject.can_request_summaries?(user)).to eq(true)
|
||||
expect(summarization.can_request_summaries?(user)).to eq(true)
|
||||
end
|
||||
|
||||
it "returns false if the user group is not present in the custom_summarization_allowed_groups_map setting" do
|
||||
SiteSetting.custom_summarization_allowed_groups = ""
|
||||
|
||||
expect(subject.can_request_summaries?(user)).to eq(false)
|
||||
expect(summarization.can_request_summaries?(user)).to eq(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user