-
Notifications
You must be signed in to change notification settings - Fork 21.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This has been broken since the logging context was added in 6be9c49 Also added a higher level test to ensure that this isn't broken again in the future.
- Loading branch information
1 parent
61d6eb1
commit 535113e
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
require "abstract_unit" | ||
|
||
class IntegrationController < ActionController::Base | ||
def yaml_params | ||
render plain: params.to_yaml | ||
end | ||
end | ||
|
||
class ActionControllerParametersIntegrationTest < ActionController::TestCase | ||
tests IntegrationController | ||
|
||
test "parameters can be serialized as yaml" do | ||
post :yaml_params, params: { person: { name: "Mjallo!" } } | ||
expected = <<~YAML | ||
--- !ruby/object:ActionController::Parameters | ||
parameters: !ruby/hash:ActiveSupport::HashWithIndifferentAccess | ||
person: !ruby/hash:ActiveSupport::HashWithIndifferentAccess | ||
name: Mjallo! | ||
controller: integration | ||
action: yaml_params | ||
permitted: false | ||
YAML | ||
assert_equal expected, response.body | ||
end | ||
end |