FIX: Allow advanced tutorial to be started if badges are disabled.
This commit is contained in:
parent
9fac5e28a5
commit
ee23ce5acc
|
@ -96,7 +96,7 @@ module DiscourseNarrativeBot
|
|||
}
|
||||
|
||||
def self.can_start?(user)
|
||||
return true if user.staff?
|
||||
return true if user.staff? || !SiteSetting.enable_badges
|
||||
user.badges.where(name: DiscourseNarrativeBot::NewUserNarrative::BADGE_NAME).exists?
|
||||
end
|
||||
|
||||
|
|
|
@ -33,6 +33,13 @@ RSpec.describe DiscourseNarrativeBot::AdvancedUserNarrative do
|
|||
expect(described_class.can_start?(user)).to eq(true)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'when badges are disabled' do
|
||||
it 'should return true' do
|
||||
SiteSetting.enable_badges = false
|
||||
expect(described_class.can_start?(user)).to eq(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#notify_timeout' do
|
||||
|
|
Loading…
Reference in New Issue