diff --git a/Gemfile.lock b/Gemfile.lock
index a1168ed3b7a57b8a027ad46eb0679074518836a1..3c7cb6cf4390c2adb906beb393e42b9da80ca1de 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -443,6 +443,10 @@ GEM
     omniauth (1.2.2)
       hashie (>= 1.2, < 4)
       rack (~> 1.0)
+    omniauth-azure-oauth2 (0.0.6)
+      jwt (~> 1.0)
+      omniauth (~> 1.0)
+      omniauth-oauth2 (~> 1.1)
     omniauth-bitbucket (0.0.2)
       multi_json (~> 1.7)
       omniauth (~> 1.1)
@@ -488,10 +492,6 @@ GEM
       activesupport
       nokogiri (>= 1.4.4)
       omniauth (~> 1.0)
-    omniauth-azure-oauth2 (0.0.6)
-      jwt (~> 1.0)
-      omniauth (~> 1.0)
-      omniauth-oauth2 (~> 1.1)
     opennebula (4.14.2)
       json
       nokogiri
@@ -920,6 +920,7 @@ DEPENDENCIES
   oauth2 (~> 1.0.0)
   octokit (~> 3.7.0)
   omniauth (~> 1.2.2)
+  omniauth-azure-oauth2
   omniauth-bitbucket (~> 0.0.2)
   omniauth-cas3 (~> 1.1.2)
   omniauth-facebook (~> 3.0.0)
@@ -931,7 +932,6 @@ DEPENDENCIES
   omniauth-shibboleth (~> 1.2.0)
   omniauth-twitter (~> 1.2.0)
   omniauth_crowd
-  omniauth-azure-oauth2
   org-ruby (~> 0.9.12)
   paranoia (~> 2.0)
   pg (~> 0.18.2)
diff --git a/spec/lib/gitlab/email/receiver_spec.rb b/spec/lib/gitlab/email/receiver_spec.rb
index b535413bbd4bfca3784dc1e5dd7c3c59987261d4..abe179cd4af160d27f5bff11e688ba62d03ce11b 100644
--- a/spec/lib/gitlab/email/receiver_spec.rb
+++ b/spec/lib/gitlab/email/receiver_spec.rb
@@ -42,7 +42,7 @@ describe Gitlab::Email::Receiver, lib: true do
   context "when the email was auto generated" do
     let!(:reply_key) { '636ca428858779856c226bb145ef4fad' }
     let!(:email_raw) { fixture_file("emails/auto_reply.eml") }
-    
+
     it "raises an AutoGeneratedEmailError" do
       expect { receiver.execute }.to raise_error(Gitlab::Email::Receiver::AutoGeneratedEmailError)
     end
@@ -90,7 +90,7 @@ describe Gitlab::Email::Receiver, lib: true do
 
   context "when the reply is blank" do
     let!(:email_raw) { fixture_file("emails/no_content_reply.eml") }
-    
+
     it "raises an EmptyEmailError" do
       expect { receiver.execute }.to raise_error(Gitlab::Email::Receiver::EmptyEmailError)
     end
@@ -107,13 +107,16 @@ describe Gitlab::Email::Receiver, lib: true do
   end
 
   context "when everything is fine" do
+    let(:markdown) { "![image](uploads/image.png)" }
+
     before do
       allow_any_instance_of(Gitlab::Email::AttachmentUploader).to receive(:execute).and_return(
         [
           {
             url: "uploads/image.png",
             is_image: true,
-            alt: "image"
+            alt: "image",
+            markdown: markdown
           }
         ]
       )
@@ -132,7 +135,7 @@ describe Gitlab::Email::Receiver, lib: true do
 
       note = noteable.notes.last
 
-      expect(note.note).to include("![image](uploads/image.png)")
+      expect(note.note).to include(markdown)
     end
   end
 end