Martin Brennan 7edf6d86e4
FIX: Use Guardian.basic_user instead of new (anon) (#270)
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.
2023-12-06 12:00:43 +10:00

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