mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 19:29:34 +08:00
update front-end specs
This commit is contained in:
@ -20,6 +20,7 @@ module("Discourse.ClickTrack", {
|
||||
' <a id="inside-onebox-forced" class="track-link" href="http://www.google.com">google.com<span class="badge">1</span></a>',
|
||||
' </div>',
|
||||
' <a id="same-site" href="http://discuss.domain.com">forum</a>',
|
||||
' <a class="attachment" href="http://discuss.domain.com/uploads/default/1234/1532357280.txt">log.txt</a>',
|
||||
' </article>',
|
||||
'</div>'].join("\n"));
|
||||
},
|
||||
@ -156,6 +157,13 @@ test("tracks via AJAX if we're on the same site", function() {
|
||||
ok(Discourse.URL.routeTo.calledOnce);
|
||||
});
|
||||
|
||||
test("does not track via AJAX for attachments", function() {
|
||||
this.stub(Discourse.URL, "routeTo");
|
||||
this.stub(Discourse.URL, "origin").returns("http://discuss.domain.com");
|
||||
|
||||
ok(!track(generateClickEventOn('.attachment')));
|
||||
ok(Discourse.URL.redirectTo.calledOnce);
|
||||
});
|
||||
|
||||
test("tracks custom urls when opening in another window", function() {
|
||||
var clickEvent = generateClickEventOn('a');
|
||||
|
Reference in New Issue
Block a user