mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-25 03:18:54 +08:00
These were deprecated in May 2025. https://meta.discourse.org/t/modernizing-inline-script-tags-for-templates-js-api/366482
27 lines
772 B
Ruby
Vendored
27 lines
772 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
RSpec.describe "When ActiveRecord is preventing writes" do
|
|
it "should not result in an error response when there is a theme field that needs to be baked" do
|
|
theme_field =
|
|
Fabricate(
|
|
:theme_field,
|
|
type_id: ThemeField.types[:html],
|
|
target_id: Theme.targets[:common],
|
|
name: "head_tag",
|
|
value: <<~HTML,
|
|
<script>
|
|
console.log('foo');
|
|
</script>
|
|
HTML
|
|
)
|
|
|
|
SiteSetting.default_theme_id = theme_field.theme_id
|
|
|
|
ActiveRecord::Base.connected_to(role: ActiveRecord.writing_role, prevent_writes: true) do
|
|
get "/latest"
|
|
|
|
expect(request.env[:resolved_theme_id]).to eq(theme_field.theme_id)
|
|
expect(response.status).to eq(200)
|
|
end
|
|
end
|
|
end
|