Commit a341be76 authored by Steffen van Bergerem's avatar Steffen van Bergerem Committed by Benjamin Neff

Bump markdown-it-diaspora-mention

parent 6e7910b0
......@@ -666,7 +666,7 @@ GEM
rails-assets-jquery (>= 1.6)
rails-assets-markdown-it--markdown-it-for-inline (0.1.1)
rails-assets-markdown-it (8.0.0)
rails-assets-markdown-it-diaspora-mention (1.0.0)
rails-assets-markdown-it-diaspora-mention (1.1.0)
rails-assets-markdown-it-hashtag (0.4.0)
rails-assets-markdown-it-sanitizer (0.4.3)
rails-assets-markdown-it-sub (1.0.0)
......@@ -1002,7 +1002,7 @@ DEPENDENCIES
rails-assets-jquery-textchange (= 0.2.3)!
rails-assets-markdown-it (= 8.0.0)!
rails-assets-markdown-it--markdown-it-for-inline (= 0.1.1)!
rails-assets-markdown-it-diaspora-mention (= 1.0.0)!
rails-assets-markdown-it-diaspora-mention (= 1.1.0)!
rails-assets-markdown-it-hashtag (= 0.4.0)!
rails-assets-markdown-it-sanitizer (= 0.4.3)!
rails-assets-markdown-it-sub (= 1.0.0)!
......
......@@ -86,6 +86,25 @@ describe("app.helpers.textFormatter", function(){
expect(wrapper.find("a[href='/people/" + this.alice.guid + "']")).not.toHaveClass('hovercardable');
expect(wrapper.find("a[href='/people/" + this.bob.guid + "']")).toHaveClass('hovercardable');
});
it("supports mentions without a given name", function() {
this.statusMessage.set({text: "hey there @{alice@example.com} and @{bob@example.com}"});
var formattedText = this.formatter(this.statusMessage.get("text"), this.statusMessage.get("mentioned_people"));
var wrapper = $("<div>").html(formattedText);
_.each([this.alice, this.bob], function(person) {
expect(wrapper.find("a[href='/people/" + person.guid + "']").text()).toContain(person.name);
});
});
it("it uses the name given in the mention if it exists", function() {
this.statusMessage.set({text: "hey there @{Alice Awesome; alice@example.com} and @{bob@example.com}"});
var formattedText = this.formatter(this.statusMessage.get("text"), this.statusMessage.get("mentioned_people"));
var wrapper = $("<div>").html(formattedText);
expect(wrapper.find("a[href='/people/" + this.alice.guid + "']").text()).toContain("Alice Awesome");
expect(wrapper.find("a[href='/people/" + this.bob.guid + "']").text()).toContain(this.bob.name);
});
});
context("highlight", function(){
......
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