Skip to content

Fix emails_controller_spec in jh

What does this MR do and why?

Fix spec in spec/controllers/profiles/emails_controller_spec.rb:71 in JH repo.

Because we add email resend confirmation frequency limits in JH repo, then this spec is failed.

Codes in jh/app/services/jh/emails/confirm_service.rb

Spec errors

Failures:

  1) Profiles::EmailsController#resend_confirmation_instructions resends an email confirmation
     Failure/Error: expect { subject }.to change { ActionMailer::Base.deliveries.size }
       expected `ActionMailer::Base.deliveries.size` to have changed, but is still 0
     # ./spec/controllers/profiles/emails_controller_spec.rb:72:in `block (3 levels) in <top (required)>'
     # ./spec/controllers/profiles/emails_controller_spec.rb:14:in `block (3 levels) in <top (required)>'
     # ./spec/controllers/profiles/emails_controller_spec.rb:13:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:423:in `block (3 levels) in <top (required)>'
     # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
     # ./spec/spec_helper.rb:414:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:410:in `block (3 levels) in <top (required)>'
     # ./lib/gitlab/application_context.rb:48:in `with_raw_context'
     # ./spec/spec_helper.rb:410:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:268:in `block (2 levels) in <top (required)>'
     # ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <main>'
     # ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <main>'
     # ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'
     # ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <main>'
     # ./jh/spec/spec_helper.rb:15:in `block (2 levels) in <main>'

Finished in 15.13 seconds (files took 13.68 seconds to load)
8 examples, 1 failure

Failed examples:

rspec ./spec/controllers/profiles/emails_controller_spec.rb:71 # Profiles::EmailsController#resend_confirmation_instructions resends an email confirmation

/cc @daveliu

Edited by Linjie Zhang

Merge request reports