Skip to content

Instantly share code, notes, and snippets.

@skipkayhil
Created June 18, 2022 22:13
Show Gist options
  • Save skipkayhil/1897d8bfcea72003c58a9ebcdf17f3c7 to your computer and use it in GitHub Desktop.
Save skipkayhil/1897d8bfcea72003c58a9ebcdf17f3c7 to your computer and use it in GitHub Desktop.
Script showing activerecord-session_store prevent configuring AD:Request
Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...
Using rake 13.0.6
Using concurrent-ruby 1.1.10
Using minitest 5.16.0
Using builder 3.2.4
Using erubi 1.10.0
Using racc 1.6.0
Using crass 1.0.6
Using rack 2.2.3.1
Using nio4r 2.5.8
Using websocket-extensions 0.1.5
Using marcel 1.0.2
Using mini_mime 1.1.2
Using digest 3.1.0
Using timeout 0.3.0
Using strscan 3.0.3
Using multi_json 1.15.0
Using method_source 1.0.0
Using thor 1.2.1
Using zeitwerk 2.6.0
Using bundler 2.3.15
Using i18n 1.10.0
Using tzinfo 2.0.4
Using nokogiri 1.13.6 (x86_64-linux)
Using activesupport 7.0.3
Using rack-test 1.1.0
Using mail 2.7.1
Using loofah 2.18.0
Using rails-html-sanitizer 1.4.3
Using websocket-driver 0.7.5
Using net-protocol 0.1.3
Using globalid 1.0.0
Using activemodel 7.0.3
Using net-imap 0.2.3
Using net-pop 0.1.1
Using rails-dom-testing 2.0.3
Using net-smtp 0.3.1
Using activejob 7.0.3
Using actionview 7.0.3
Using activerecord 7.0.3
Using actionpack 7.0.3
Using actioncable 7.0.3
Using activestorage 7.0.3
Using railties 7.0.3
Using actionmailer 7.0.3
Using activerecord-session_store 2.0.0
Using actiontext 7.0.3
Using actionmailbox 7.0.3
Using rails 7.0.3
load ad:request <- ActionDispatch::Request load triggers before the initializer runs
initializer
Run options: --seed 37579
# Running:
F
Failure:
BugTest#test_action_dispatch_request_config [test.rb:50]:
Expected: #<Object:0x00007f7aa9ecd6e8>
Actual: true
rails test test.rb:48
Finished in 0.004323s, 231.3120 runs/s, 462.6239 assertions/s.
1 runs, 2 assertions, 1 failures, 0 errors, 0 skips
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Activate the gem you are reporting the issue against.
gem "rails", "~> 7.0.0"
gem "activerecord-session_store"
end
require "rack/test"
require "action_controller/railtie"
$value = Object.new
ActiveSupport.on_load(:action_dispatch_request) do
puts 'load ad:request'
end
class TestApp < Rails::Application
config.eager_load = false
# config.root = __dir__
# config.hosts << "example.org"
# config.session_store :cookie_store
secrets.secret_key_base = "secret_key_base"
config.logger = Logger.new($stdout)
Rails.logger = config.logger
initializer "new_framework_defaults" do |app|
puts 'initializer'
app.config.action_dispatch.return_only_request_media_type_on_content_type = $value
end
end
Rails.application.initialize!
require "minitest/autorun"
class BugTest < Minitest::Test
include Rack::Test::Methods
def test_action_dispatch_request_config
assert_equal $value, app.config.action_dispatch.return_only_request_media_type_on_content_type
assert_equal $value, ActionDispatch::Request.return_only_media_type_on_content_type
end
private
def app
Rails.application
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment