Fix Ruby 2.7 deprecation warnings in invites_controller_spec.rb
What does this MR do?
Fixes the Ruby 2.7 deprecation warnings that appear in the invites_controller_spec.rb
per the project-wide effort described in #257438 (closed)
Screenshots
Warnings before:
rspec spec/controllers/invites_controller_spec.rb
Running via Spring preloader in process 53208
Run options: include {:focus=>true}
All examples were filtered out; ignoring {:focus=>true}
/Users/steveabrams/workspace/gdk-ee/gitlab/config/initializers/forbid_sidekiq_in_transactions.rb:50: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/steveabrams/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.1/lib/active_record/transactions.rb:334: warning: The called method `committed!' is defined here
/Users/steveabrams/workspace/gdk-ee/gitlab/spec/support/helpers/stubbed_feature.rb:33: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/steveabrams/workspace/gdk-ee/gitlab/lib/feature.rb:61: warning: The called method `enabled?' is defined here
/Users/steveabrams/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/state_machines-activerecord-0.6.0/lib/state_machines/integrations/active_record.rb:511: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/steveabrams/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.1/lib/active_record/suppressor.rb:43: warning: The called method `save' is defined here
/Users/steveabrams/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/devise-4.7.1/lib/devise/test/controller_helpers.rb:35: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/steveabrams/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rails-controller-testing-1.0.5/lib/rails/controller/testing/template_assertions.rb:60: warning: The called method `process' is defined here
/Users/steveabrams/workspace/gdk-ee/gitlab/app/services/notification_recipients/build_service.rb:13: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/steveabrams/workspace/gdk-ee/gitlab/app/models/notification_recipient.rb:8: warning: The called method `initialize' is defined here
/Users/steveabrams/workspace/gdk-ee/gitlab/app/models/user_interacted_project.rb:24: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/steveabrams/workspace/gdk-ee/gitlab/app/models/user_interacted_project.rb:40: warning: The called method `cached_exists?' is defined here
.../Users/steveabrams/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/message_expectation.rb:101: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/steveabrams/workspace/gdk-ee/gitlab/lib/gitlab/tracking.rb:29: warning: The called method `event' is defined here
/Users/steveabrams/workspace/gdk-ee/gitlab/spec/controllers/invites_controller_spec.rb:112: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/steveabrams/workspace/gdk-ee/gitlab/spec/support/helpers/snowplow_helpers.rb:34: warning: The called method `expect_snowplow_event' is defined here
/Users/steveabrams/workspace/gdk-ee/gitlab/spec/controllers/invites_controller_spec.rb:113: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/steveabrams/workspace/gdk-ee/gitlab/spec/support/helpers/snowplow_helpers.rb:34: warning: The called method `expect_snowplow_event' is defined here
./Users/steveabrams/workspace/gdk-ee/gitlab/spec/controllers/invites_controller_spec.rb:124: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/steveabrams/workspace/gdk-ee/gitlab/spec/support/helpers/snowplow_helpers.rb:34: warning: The called method `expect_snowplow_event' is defined here
/Users/steveabrams/workspace/gdk-ee/gitlab/spec/controllers/invites_controller_spec.rb:125: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/steveabrams/workspace/gdk-ee/gitlab/spec/support/helpers/snowplow_helpers.rb:34: warning: The called method `expect_snowplow_event' is defined here
......./Users/steveabrams/workspace/gdk-ee/gitlab/spec/controllers/invites_controller_spec.rb:176: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/steveabrams/workspace/gdk-ee/gitlab/spec/support/helpers/snowplow_helpers.rb:34: warning: The called method `expect_snowplow_event' is defined here
./Users/steveabrams/workspace/gdk-ee/gitlab/spec/controllers/invites_controller_spec.rb:187: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/steveabrams/workspace/gdk-ee/gitlab/spec/support/helpers/snowplow_helpers.rb:34: warning: The called method `expect_snowplow_event' is defined here
......
Warnings After:
rspec spec/controllers/invites_controller_spec.rb
Running via Spring preloader in process 58734
Run options: include {:focus=>true}
All examples were filtered out; ignoring {:focus=>true}
/Users/steveabrams/workspace/gdk-ee/gitlab/config/initializers/forbid_sidekiq_in_transactions.rb:50: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/steveabrams/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.1/lib/active_record/transactions.rb:334: warning: The called method `committed!' is defined here
/Users/steveabrams/workspace/gdk-ee/gitlab/spec/support/helpers/stubbed_feature.rb:33: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/steveabrams/workspace/gdk-ee/gitlab/lib/feature.rb:61: warning: The called method `enabled?' is defined here
/Users/steveabrams/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/state_machines-activerecord-0.6.0/lib/state_machines/integrations/active_record.rb:511: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/steveabrams/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.1/lib/active_record/suppressor.rb:43: warning: The called method `save' is defined here
/Users/steveabrams/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/devise-4.7.1/lib/devise/test/controller_helpers.rb:35: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/steveabrams/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rails-controller-testing-1.0.5/lib/rails/controller/testing/template_assertions.rb:60: warning: The called method `process' is defined here
/Users/steveabrams/workspace/gdk-ee/gitlab/app/services/notification_recipients/build_service.rb:13: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/steveabrams/workspace/gdk-ee/gitlab/app/models/notification_recipient.rb:8: warning: The called method `initialize' is defined here
/Users/steveabrams/workspace/gdk-ee/gitlab/app/models/user_interacted_project.rb:24: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/steveabrams/workspace/gdk-ee/gitlab/app/models/user_interacted_project.rb:40: warning: The called method `cached_exists?' is defined here
.../Users/steveabrams/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rspec-mocks-3.9.1/lib/rspec/mocks/message_expectation.rb:101: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/steveabrams/workspace/gdk-ee/gitlab/lib/gitlab/tracking.rb:29: warning: The called method `event' is defined here
...............
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
- [-] Code review guidelines
- [-] Merge request performance guidelines
- [-] Style guides
- [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
- [-] Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
- [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Related #257438 (closed)
Edited by Steve Abrams