mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
DEV: Apply syntax_tree formatting to spec/*
This commit is contained in:
@ -1,21 +1,23 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe Middleware::EnforceHostname do
|
||||
|
||||
before do
|
||||
RailsMultisite::ConnectionManagement.stubs(:current_db_hostnames).returns(['primary.example.com', 'secondary.example.com'])
|
||||
RailsMultisite::ConnectionManagement.stubs(:current_hostname).returns('primary.example.com')
|
||||
RailsMultisite::ConnectionManagement.stubs(:current_db_hostnames).returns(
|
||||
%w[primary.example.com secondary.example.com],
|
||||
)
|
||||
RailsMultisite::ConnectionManagement.stubs(:current_hostname).returns("primary.example.com")
|
||||
end
|
||||
|
||||
def check_returned_host(input_host)
|
||||
resolved_host = nil
|
||||
|
||||
app = described_class.new(
|
||||
lambda do |env|
|
||||
resolved_host = env["HTTP_HOST"]
|
||||
[200, {}, ["ok"]]
|
||||
end
|
||||
)
|
||||
app =
|
||||
described_class.new(
|
||||
lambda do |env|
|
||||
resolved_host = env["HTTP_HOST"]
|
||||
[200, {}, ["ok"]]
|
||||
end,
|
||||
)
|
||||
|
||||
app.call({ "HTTP_HOST" => input_host })
|
||||
|
||||
|
Reference in New Issue
Block a user