mirror of
https://github.com/discourse/discourse.git
synced 2024-12-19 04:30:32 +08:00
493d437e79
* Remove outdated option
04078317ba
* Use the non-globally exposed RSpec syntax
https://github.com/rspec/rspec-core/pull/2803
* Use the non-globally exposed RSpec syntax, cont
https://github.com/rspec/rspec-core/pull/2803
* Comply to strict predicate matchers
See:
- https://github.com/rspec/rspec-expectations/pull/1195
- https://github.com/rspec/rspec-expectations/pull/1196
- https://github.com/rspec/rspec-expectations/pull/1277
16 lines
571 B
Ruby
16 lines
571 B
Ruby
# 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
|