mirror of
https://github.com/discourse/discourse.git
synced 2026-08-11 02:59:07 +08:00
We want to enable the Solved badges by default so that communities can more easily acknowledge their engaged and contributing members. For sites that have the Solved plugin enabled — we will show an upcoming change labelled "Enabled Solved Badges". When the upcoming change is enabled (either manually or via auto-promotion) we will update all 4 solved badges to enabled. When opting out of this upcoming change we will disable all 4 solved badges.
18 lines
609 B
Ruby
Vendored
18 lines
609 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
RSpec.describe "Enable Solved badges by default upcoming change" do
|
|
let(:badge_names) { ["Solved 1", "Solved 2", "Solved 3", "Solved 4"] }
|
|
|
|
def reseed_solved_badges
|
|
Badge.where(name: badge_names).delete_all
|
|
load Rails.root.join("plugins/discourse-solved/db/fixtures/001_badges.rb") # rubocop:disable Discourse/Plugins/UseRequireRelative
|
|
end
|
|
|
|
describe "seeding the Solved badges on a new site" do
|
|
it "enables the badges by default" do
|
|
reseed_solved_badges
|
|
|
|
expect(Badge.where(name: badge_names).pluck(:enabled)).to all(eq(true))
|
|
end
|
|
end
|
|
end
|