diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-05-20 13:05:57 -0500 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-05-20 13:05:57 -0500 |
commit | 9436a444f3e890ad48b64c26ec95ffde4ed9e87c (patch) | |
tree | bcec2954e67f7ddec48fe74779db1cfeda8626b8 | |
parent | 4b341dea5547889fd8fe6239d28c453de194c7db (diff) | |
download | gitlab-ce-9436a444f3e890ad48b64c26ec95ffde4ed9e87c.tar.gz |
Rename reply_key to mail_key
-rw-r--r-- | spec/fixtures/emails/wrong_mail_key.eml (renamed from spec/fixtures/emails/wrong_reply_key.eml) | 0 | ||||
-rw-r--r-- | spec/lib/gitlab/email/receiver_spec.rb | 22 |
2 files changed, 11 insertions, 11 deletions
diff --git a/spec/fixtures/emails/wrong_reply_key.eml b/spec/fixtures/emails/wrong_mail_key.eml index 491e078fb5b..491e078fb5b 100644 --- a/spec/fixtures/emails/wrong_reply_key.eml +++ b/spec/fixtures/emails/wrong_mail_key.eml diff --git a/spec/lib/gitlab/email/receiver_spec.rb b/spec/lib/gitlab/email/receiver_spec.rb index c08e184c4c3..e892da7bb46 100644 --- a/spec/lib/gitlab/email/receiver_spec.rb +++ b/spec/lib/gitlab/email/receiver_spec.rb @@ -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 |