Skip to content

Instantly share code, notes, and snippets.

@hogelog
Last active July 1, 2022 05:48
Show Gist options
  • Save hogelog/482646e1e95d93b4b7de36655ab6a271 to your computer and use it in GitHub Desktop.
Save hogelog/482646e1e95d93b4b7de36655ab6a271 to your computer and use it in GitHub Desktop.
AC::Parameters test
Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...
Using rake 13.0.6
Using concurrent-ruby 1.1.10
Using minitest 5.16.1
Using builder 3.2.4
Using erubi 1.10.0
Using racc 1.6.0
Using rack 2.2.4
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 strscan 3.0.3
Using bundler 2.3.14
Using crass 1.0.6
Using method_source 1.0.0
Using timeout 0.3.0
Using thor 1.2.1
Using zeitwerk 2.6.0
Using i18n 1.10.0
Using tzinfo 2.0.4
Using nokogiri 1.13.6 (arm64-darwin)
Using net-protocol 0.1.3
Using net-imap 0.2.3
Using net-pop 0.1.1
Using net-smtp 0.3.1
Using loofah 2.18.0
Using rack-test 2.0.2
Using mail 2.7.1
Using activesupport 7.0.3
Using rails-dom-testing 2.0.3
Using rails-html-sanitizer 1.4.3
Using websocket-driver 0.7.5
Using globalid 1.0.0
Using activemodel 7.0.3
Using actionview 7.0.3
Using activejob 7.0.3
Using activerecord 7.0.3
Using actionpack 7.0.3
Using actioncable 7.0.3
Using actionmailer 7.0.3
Using railties 7.0.3
Using activestorage 7.0.3
Using actiontext 7.0.3
Using actionmailbox 7.0.3
Using rails 7.0.3
Run options: --seed 55777
# Running:
F
Failure:
BugTest#test_returns_success [parameters_test.rb:27]:
Expected false to be truthy.
rails test parameters_test.rb:22
Finished in 0.005643s, 177.2107 runs/s, 145667.1980 assertions/s.
1 runs, 822 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.3"
# gem "rails", github: "rails/rails", ref: "ec0c6c7"
end
require "rack/test"
require "action_controller"
require "minitest/autorun"
class BugTest < Minitest::Test
include Rack::Test::Methods
def test_returns_success
1000.times do |i|
source_hash = { foo: [ { bar: Object.new } ] }
params = ActionController::Parameters.new(source_hash)
assert params.fetch(:foo)[0].is_a?(ActionController::Parameters)
assert params.fetch(:foo)[0].is_a?(ActionController::Parameters)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment