discourse/spec/lib/theme_flag_modifier_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
571 B
Ruby
Raw Normal View History

# frozen_string_literal: true
RSpec.describe ThemeModifierHelper do
fab!(:theme) { Fabricate(:theme).tap { |t| t.theme_modifier_set.update!(serialize_topic_excerpts: true) } }
it "defines a getter for modifiers" do
tmh = ThemeModifierHelper.new(theme_ids: [theme.id])
expect(tmh.serialize_topic_excerpts).to eq(true)
end
it "can extract theme ids from a request object" do
request = Rack::Request.new({ resolved_theme_id: theme.id })
tmh = ThemeModifierHelper.new(request: request)
expect(tmh.serialize_topic_excerpts).to eq(true)
end
end