diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /spec/lib/gitlab/email | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'spec/lib/gitlab/email')
-rw-r--r-- | spec/lib/gitlab/email/handler/service_desk_handler_spec.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/email/reply_parser_spec.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/email/smime/certificate_spec.rb | 14 |
3 files changed, 9 insertions, 9 deletions
diff --git a/spec/lib/gitlab/email/handler/service_desk_handler_spec.rb b/spec/lib/gitlab/email/handler/service_desk_handler_spec.rb index 2ebfb054a96..32b451f8329 100644 --- a/spec/lib/gitlab/email/handler/service_desk_handler_spec.rb +++ b/spec/lib/gitlab/email/handler/service_desk_handler_spec.rb @@ -254,7 +254,7 @@ RSpec.describe Gitlab::Email::Handler::ServiceDeskHandler do new_issue = Issue.last - expect(new_issue.service_desk_reply_to).to eq('finn@adventuretime.ooo') + expect(new_issue.external_author).to eq('finn@adventuretime.ooo') end end diff --git a/spec/lib/gitlab/email/reply_parser_spec.rb b/spec/lib/gitlab/email/reply_parser_spec.rb index 575ff7f357b..bc4c6cf007d 100644 --- a/spec/lib/gitlab/email/reply_parser_spec.rb +++ b/spec/lib/gitlab/email/reply_parser_spec.rb @@ -6,7 +6,7 @@ require "spec_helper" RSpec.describe Gitlab::Email::ReplyParser do describe '#execute' do def test_parse_body(mail_string, params = {}) - described_class.new(Mail::Message.new(mail_string), params).execute + described_class.new(Mail::Message.new(mail_string), **params).execute end it "returns an empty string if the message is blank" do diff --git a/spec/lib/gitlab/email/smime/certificate_spec.rb b/spec/lib/gitlab/email/smime/certificate_spec.rb index e4a085d971b..f7bb933e348 100644 --- a/spec/lib/gitlab/email/smime/certificate_spec.rb +++ b/spec/lib/gitlab/email/smime/certificate_spec.rb @@ -69,8 +69,8 @@ RSpec.describe Gitlab::Email::Smime::Certificate do describe '.from_files' do it 'parses correctly a certificate and key' do - allow(File).to receive(:read).with('a_key').and_return(@cert[:key].to_s) - allow(File).to receive(:read).with('a_cert').and_return(@cert[:cert].to_pem) + stub_file_read('a_key', content: @cert[:key].to_s) + stub_file_read('a_cert', content: @cert[:cert].to_pem) parsed_cert = described_class.from_files('a_key', 'a_cert') @@ -79,9 +79,9 @@ RSpec.describe Gitlab::Email::Smime::Certificate do context 'with optional ca_certs' do it 'parses correctly certificate, key and ca_certs' do - allow(File).to receive(:read).with('a_key').and_return(@cert[:key].to_s) - allow(File).to receive(:read).with('a_cert').and_return(@cert[:cert].to_pem) - allow(File).to receive(:read).with('a_ca_cert').and_return(@intermediate_ca[:cert].to_pem) + stub_file_read('a_key', content: @cert[:key].to_s) + stub_file_read('a_cert', content: @cert[:cert].to_pem) + stub_file_read('a_ca_cert', content: @intermediate_ca[:cert].to_pem) parsed_cert = described_class.from_files('a_key', 'a_cert', 'a_ca_cert') @@ -94,8 +94,8 @@ RSpec.describe Gitlab::Email::Smime::Certificate do it 'parses correctly a certificate and key' do cert = generate_cert(signer_ca: @root_ca) - allow(File).to receive(:read).with('a_key').and_return(cert[:key].to_s) - allow(File).to receive(:read).with('a_cert').and_return(cert[:cert].to_pem) + stub_file_read('a_key', content: cert[:key].to_s) + stub_file_read('a_cert', content: cert[:cert].to_pem) parsed_cert = described_class.from_files('a_key', 'a_cert') |