Commit 9436a444 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Rename reply_key to mail_key

parent 4b341dea
......@@ -6,13 +6,13 @@ describe Gitlab::Email::Receiver, lib: true do
stub_config_setting(host: 'localhost')
end
let(:reply_key) { "59d8df8370b7e95c5a49fbf86aeb2c93" }
let(:mail_key) { "59d8df8370b7e95c5a49fbf86aeb2c93" }
let(:email_raw) { fixture_file('emails/valid_reply.eml') }
let(:project) { create(:project, :public) }
let(:noteable) { create(:issue, project: project) }
let(:user) { create(:user) }
let!(:sent_notification) { SentNotification.record(noteable, user.id, reply_key) }
let!(:sent_notification) { SentNotification.record(noteable, user.id, mail_key) }
let(:receiver) { described_class.new(email_raw) }
let(:markdown) { "![image](uploads/image.png)" }
......@@ -30,16 +30,16 @@ describe Gitlab::Email::Receiver, lib: true do
)
end
context "when the recipient address doesn't include a reply key" do
let(:email_raw) { fixture_file('emails/valid_reply.eml').gsub(reply_key, "") }
context "when the recipient address doesn't include a mail key" do
let(:email_raw) { fixture_file('emails/valid_reply.eml').gsub(mail_key, "") }
it "raises a SentNotificationNotFoundError" do
expect { receiver.execute }.to raise_error(Gitlab::Email::SentNotificationNotFoundError)
end
end
context "when no sent notification for the reply key could be found" do
let(:email_raw) { fixture_file('emails/wrong_reply_key.eml') }
context "when no sent notification for the mail key could be found" do
let(:email_raw) { fixture_file('emails/wrong_mail_key.eml') }
it "raises a SentNotificationNotFoundError" do
expect { receiver.execute }.to raise_error(Gitlab::Email::SentNotificationNotFoundError)
......@@ -55,7 +55,7 @@ describe Gitlab::Email::Receiver, lib: true do
end
context "when the email was auto generated" do
let!(:reply_key) { '636ca428858779856c226bb145ef4fad' }
let!(:mail_key) { '636ca428858779856c226bb145ef4fad' }
let!(:email_raw) { fixture_file("emails/auto_reply.eml") }
it "raises an AutoGeneratedEmailError" do
......@@ -147,8 +147,8 @@ describe Gitlab::Email::Receiver, lib: true do
stub_incoming_email_setting(enabled: true, address: nil)
end
shared_examples 'an email that contains a reply key' do |header|
it "fetches the reply key from the #{header} header and creates a comment" do
shared_examples 'an email that contains a mail key' do |header|
it "fetches the mail key from the #{header} header and creates a comment" do
expect { receiver.execute }.to change { noteable.notes.count }.by(1)
note = noteable.notes.last
......@@ -157,10 +157,10 @@ describe Gitlab::Email::Receiver, lib: true do
end
end
context 'reply key is in the References header' do
context 'mail key is in the References header' do
let(:email_raw) { fixture_file('emails/reply_without_subaddressing_and_key_inside_references.eml') }
it_behaves_like 'an email that contains a reply key', 'References'
it_behaves_like 'an email that contains a mail key', 'References'
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment