Fix regression introduced in 8cf0f51eb2.

This commit is contained in:
Guo Xiang Tan 2018-05-16 14:26:03 +08:00
parent 21e0b7c818
commit 565fa1f60e
2 changed files with 16 additions and 2 deletions

View File

@ -30,11 +30,11 @@ class AdminPluginSerializer < ApplicationSerializer
end
def include_enabled_setting?
object.enabled_site_setting
enabled_setting.present?
end
def enabled_setting
true
object.enabled_site_setting
end
def include_enabled_setting_filter?

View File

@ -0,0 +1,14 @@
require 'rails_helper'
RSpec.describe AdminPluginSerializer do
let(:instance) { Plugin::Instance.new }
subject { described_class.new(instance) }
describe 'enabled_setting' do
it 'should return the right value' do
instance.enabled_site_setting('test')
expect(subject.enabled_setting).to eq('test')
end
end
end