Fix license spec in JH repo
What does this MR do and why?
Fix spec error in ee/spec/models/license_spec.rb
in JH repo.
Basecause JH repo change the invalid license error message from The license key is invalid. Make sure it is exactly as you received it from GitLab Inc.
to The license key is invalid. Make sure it is exactly as you received it from JiHu(GitLab)
, then the spec failed in JH repo.
msgid "The license key is invalid. Make sure it is exactly as you received it from GitLab Inc."
msgstr "The license key is invalid. Make sure it is exactly as you received it from JiHu(GitLab)"
Spec failures
Failures:
1) License validations #valid_license when the license is provided with offline cloud license behaves like an invalid license adds an error
Failure/Error: expect(license.errors.full_messages.to_sentence).to include error_message
expected "The license key is invalid. Make sure it is exactly as you received it from JiHu(GitLab)" to include "The license key is invalid. Make sure it is exactly as you received it from GitLab Inc."
Shared Example Group: "an invalid license" called from ./ee/spec/models/license_spec.rb:37
# ./ee/spec/models/license_spec.rb:20:in `block (6 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>'
2) License validations #valid_license when no license is provided adds an error
Failure/Error:
expect(license.errors.full_messages.to_sentence)
.to include 'The license key is invalid. Make sure it is exactly as you received it from GitLab Inc.'
expected "The license key is invalid. Make sure it is exactly as you received it from JiHu(GitLab)" to include "The license key is invalid. Make sure it is exactly as you received it from GitLab Inc."
# ./ee/spec/models/license_spec.rb:50:in `block (5 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 2 minutes 2.6 seconds (files took 12.27 seconds to load)
300 examples, 2 failures
Failed examples:
rspec './ee/spec/models/license_spec.rb[1:1:1:1:2:1:1]' # License validations #valid_license when the license is provided with offline cloud license behaves like an invalid license adds an error
rspec ./ee/spec/models/license_spec.rb:48 # License validations #valid_license when no license is provided adds an error
/cc @daveliu
Edited by Linjie Zhang