2019-05-12 23:04:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-03-13 15:11:07 -04:00
|
|
|
require 'rails_helper'
|
|
|
|
require_dependency 'site'
|
|
|
|
|
|
|
|
describe Site do
|
|
|
|
let(:category) { Fabricate(:category) }
|
|
|
|
let(:guardian) { Guardian.new }
|
|
|
|
|
2019-03-15 07:55:17 -04:00
|
|
|
before do
|
|
|
|
SiteSetting.show_filter_by_solved_status = true
|
|
|
|
end
|
|
|
|
|
2019-03-13 15:11:07 -04:00
|
|
|
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
|