Skip to content

[Rails5] expected: ({...}) got: (<ActionController::Parameters {...})

Note: add rails5 to a branch name to trigger rails5 specific CI jobs.

https://gitlab.com/gitlab-org/gitlab-ee/-/jobs/77073866

  17) Admin::PushRulesController#update updates sample push rule
      Failure/Error: yield

        #<PushRule id: nil, force_push_regex: nil, delete_branch_regex: nil, commit_message_regex: nil, deny_delete_tag: nil, project_id: nil, created_at: nil, updated_at: nil, author_email_regex: nil, member_check: false, file_name_regex: nil, is_sample: true, max_file_size: 0, prevent_secrets: false, branch_name_regex: nil, reject_unsigned_commits: nil, commit_committer_check: nil, regexp_uses_re2: true, commit_message_negative_regex: nil> received :update_attributes with unexpected arguments
          expected: ({:deny_delete_tag=>true, :delete_branch_regex=>"any", :commit_message_regex=>"any", :branch_name_rege...x=>"any", :member_check=>true, :file_name_regex=>"any", :max_file_size=>"0", :prevent_secrets=>true})
               got: (<ActionController::Parameters {"deny_delete_tag"=>"true", "delete_branch_regex"=>"any", "commit_messa...>"true", "file_name_regex"=>"any", "max_file_size"=>"0", "prevent_secrets"=>"true"} permitted: true>)
        Diff:
        @@ -1,11 +1,2 @@
        -[{:deny_delete_tag=>true,
        -  :delete_branch_regex=>"any",
        -  :commit_message_regex=>"any",
        -  :branch_name_regex=>"any",
        -  :force_push_regex=>"any",
        -  :author_email_regex=>"any",
        -  :member_check=>true,
        -  :file_name_regex=>"any",
        -  :max_file_size=>"0",
        -  :prevent_secrets=>true}]
        +[<ActionController::Parameters {"deny_delete_tag"=>"true", "delete_branch_regex"=>"any", "commit_message_regex"=>"any", "branch_name_regex"=>"any", "force_push_regex"=>"any", "author_email_regex"=>"any", "member_check"=>"true", "file_name_regex"=>"any", "max_file_size"=>"0", "prevent_secrets"=>"true"} permitted: true>]
      # ./ee/app/controllers/admin/push_rules_controller.rb:11:in `update'
      # ./lib/gitlab/i18n.rb:51:in `with_locale'
      # ./lib/gitlab/i18n.rb:57:in `with_user_locale'
      # ./app/controllers/application_controller.rb:370:in `set_locale'
      # ./ee/spec/controllers/admin/push_rules_controller_spec.rb:22:in `block (3 levels) in <top (required)>'