diff --git a/test/javascripts/lib/click_track_test.js b/test/javascripts/lib/click_track_test.js
index 1a01a9bd46d..60e5b87fb92 100644
--- a/test/javascripts/lib/click_track_test.js
+++ b/test/javascripts/lib/click_track_test.js
@@ -8,7 +8,7 @@ module("Discourse.ClickTrack", {
this.windowOpen = sinon.stub(window, "open").returns(this.win);
sinon.stub(this.win, "focus");
- $('#qunit-fixture').html([
+ fixture().html([
'
',
'
',
' google.com',
@@ -37,7 +37,7 @@ var track = Discourse.ClickTrack.trackClick;
// test
var generateClickEventOn = function(selector) {
- return $.Event("click", { currentTarget: $("#qunit-fixture " + selector)[0] });
+ return $.Event("click", { currentTarget: fixture(selector)[0] });
};
test("does not track clicks on lightboxes", function() {
@@ -66,7 +66,7 @@ test("does not track clicks on quote buttons", function() {
test("removes the href and put it as a data attribute", function() {
track(generateClickEventOn('a'));
- var $link = $('#qunit-fixture a').first();
+ var $link = fixture('a').first();
ok($link.hasClass('no-href'));
equal($link.data('href'), 'http://www.google.com');
blank($link.attr('href'));
@@ -77,7 +77,7 @@ test("removes the href and put it as a data attribute", function() {
var badgeClickCount = function(id, expected) {
track(generateClickEventOn('#' + id));
- var $badge = $('span.badge', $('#qunit-fixture #' + id).first());
+ var $badge = $('span.badge', fixture('#' + id).first());
equal(parseInt($badge.html(), 10), expected);
};
@@ -105,13 +105,13 @@ var trackRightClick = function() {
test("right clicks change the href", function() {
ok(trackRightClick());
- equal($('#qunit-fixture a').first().prop('href'), "http://www.google.com/");
+ equal(fixture('a').first().prop('href'), "http://www.google.com/");
});
test("right clicks are tracked", function() {
Discourse.SiteSettings.track_external_right_clicks = true;
trackRightClick();
- equal($('#qunit-fixture a').first().attr('href'), "/clicks/track?url=http%3A%2F%2Fwww.google.com&post_id=42");
+ equal(fixture('a').first().attr('href'), "/clicks/track?url=http%3A%2F%2Fwww.google.com&post_id=42");
});