             }
 
             it("Should show the mentions list when typing a mention on a new line and remain visible when a space is added if search spaces is true") {
-                mentionsListener = generateMentionsListener(searchSpacesInMentions: true)
+                mentionsListener = generateMentionsListener(searchSpacesInMentions: true, spaceAfterMention: false)
                 textView.insertText("\n@t")
 
                 expect(self.hidingMentionsList).to(beFalsy())

            }

            it("Should show the mentions list when typing a mention on a new line and hide when a space is added if search spaces is false") {
                mentionsListener = generateMentionsListener(searchSpacesInMentions: false)
                textView.insertText("\n@t")

                expect(self.hidingMentionsList).to(beFalsy())

                expect(self.hidingMentionsList).to(beFalsy())
            }

            it("Should set cursor after added space when add a mention if spaces after mention is true") {
                mentionsListener = generateMentionsListener(searchSpacesInMentions: true, spaceAfterMention: true)

                textView.text = ""
                textView.insertText("@a")
                addMention(named: "@awesome", on: mentionsListener)

                expect("@awesome ".count).to(equal(textView.selectedRange.location))
            }

            func generateMentionsListener(searchSpacesInMentions: Bool, spaceAfterMention: Bool) -> MentionListener {
                return MentionListener(mentionsTextView: textView,
                                       spaceAfterMention: spaceAfterMention,
                                       searchSpaces: searchSpacesInMentions,
                                       hideMentions: hideMentions,
                                       didHandleMentionOnReturn: { true },
