mirror of
https://github.com/discourse/discourse-solved.git
synced 2025-03-09 14:37:15 +00:00
c.f. de983796e1b66aa2ab039a4fb6e32cec8a65a098 There will soon be additional login_required checks for Guardian, and the intent of many checks by automated systems is better fulfilled by using BasicUser, which simulates a logged in TL0 forum user, rather than an anon user.
21 lines
512 B
Ruby
21 lines
512 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "rails_helper"
|
|
require_dependency "site"
|
|
|
|
describe Site do
|
|
let(:category) { Fabricate(:category) }
|
|
let(:guardian) { Guardian.basic_user }
|
|
|
|
before { SiteSetting.show_filter_by_solved_status = true }
|
|
|
|
it "includes `enable_accepted_answers` custom field for categories" do
|
|
category.custom_fields["enable_accepted_answers"] = true
|
|
category.save_custom_fields
|
|
|
|
json = Site.json_for(guardian)
|
|
|
|
expect(json).to include("enable_accepted_answers")
|
|
end
|
|
end
|