diff --git a/app/serializers/admin_plugin_serializer.rb b/app/serializers/admin_plugin_serializer.rb index 2ac11f34134..b1150714968 100644 --- a/app/serializers/admin_plugin_serializer.rb +++ b/app/serializers/admin_plugin_serializer.rb @@ -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? diff --git a/spec/serializers/admin_plugin_serializer_spec.rb b/spec/serializers/admin_plugin_serializer_spec.rb new file mode 100644 index 00000000000..70d8430a050 --- /dev/null +++ b/spec/serializers/admin_plugin_serializer_spec.rb @@ -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