From 347ee6cc912d49680d2f6b90134142c656868333 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Thu, 31 Mar 2016 21:56:37 +0800 Subject: Alloy empty reply for new issues, but not response --- spec/lib/gitlab/email/receiver_spec.rb | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'spec/lib/gitlab/email') diff --git a/spec/lib/gitlab/email/receiver_spec.rb b/spec/lib/gitlab/email/receiver_spec.rb index e7391a33751..4336f0f9e53 100644 --- a/spec/lib/gitlab/email/receiver_spec.rb +++ b/spec/lib/gitlab/email/receiver_spec.rb @@ -167,7 +167,6 @@ describe Gitlab::Email::Receiver, lib: true do context "when it's trying to create a new issue" do before do - setup_attachment stub_incoming_email_setting(enabled: true, address: "incoming+%{key}@appmail.adventuretime.ooo") end @@ -179,6 +178,8 @@ describe Gitlab::Email::Receiver, lib: true do context "when everything is fine" do it "creates a new issue" do + setup_attachment + expect { receiver.execute }.to change { project.issues.count }.by(1) issue = project.issues.last @@ -187,6 +188,19 @@ describe Gitlab::Email::Receiver, lib: true do expect(issue.description).to include('reply by email') expect(issue.description).to include(markdown) end + + context "when the reply is blank" do + let!(:email_raw) { fixture_file("emails/valid_new_issue_empty.eml") } + + it "creates a new issue" do + expect { receiver.execute }.to change { project.issues.count }.by(1) + issue = project.issues.last + + expect(issue.author).to eq(user) + expect(issue.title).to eq('New Issue by email') + expect(issue.description).to eq('') + end + end end context "something is wrong" do -- cgit v1.2.1