DEV: Apply syntax_tree formatting to spec/*

This commit is contained in:
David Taylor
2023-01-09 11:18:21 +00:00
parent 0cf6421716
commit cb932d6ee1
907 changed files with 58693 additions and 45909 deletions

View File

@ -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 })