mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 20:03:44 +08:00
13d00eaad0
In particular, this includes Internet Explorer 11. Code which existed to support old browsers will be removed over the coming weeks. https://meta.discourse.org/t/discourse-is-ending-support-for-internet-explorer-11-ie11-on-june-1-2020/137984
29 lines
733 B
Ruby
29 lines
733 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "rails_helper"
|
|
|
|
describe Middleware::AnonymousCache::Helper do
|
|
before { SiteSetting.discourse_unsupported_browser_enabled = true }
|
|
|
|
def env(opts = {})
|
|
{
|
|
"HTTP_HOST" => "http://test.com",
|
|
"REQUEST_URI" => "/path?bla=1",
|
|
"REQUEST_METHOD" => "GET",
|
|
"rack.input" => ""
|
|
}.merge(opts)
|
|
end
|
|
|
|
def new_helper(opts = {})
|
|
Middleware::AnonymousCache::Helper.new(env(opts))
|
|
end
|
|
|
|
it "includes ie in cache key" do
|
|
helper = new_helper
|
|
expect(helper.cache_key).to include("ie=false")
|
|
|
|
helper = new_helper("HTTP_USER_AGENT" => "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko")
|
|
expect(helper.cache_key).to include("ie=true")
|
|
end
|
|
end
|