From f7c7d38a307a6eeb2db3e570b9199334e2cb07cd Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 28 Jul 2014 12:05:27 +1000 Subject: [PATCH] FIX: broken tests --- test/javascripts/controllers/site_map_controller_test.js | 2 ++ test/javascripts/integration/header_test.js | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/javascripts/controllers/site_map_controller_test.js b/test/javascripts/controllers/site_map_controller_test.js index ba601593dd9..b0fc3f386e4 100644 --- a/test/javascripts/controllers/site_map_controller_test.js +++ b/test/javascripts/controllers/site_map_controller_test.js @@ -50,11 +50,13 @@ test("faqUrl returns default '/faq' url when there is no corresponding site sett test("showMoblieToggle returns true when mobile theme is enabled in site settings", function() { Discourse.SiteSettings.enable_mobile_theme = true; + Discourse.Mobile.isMobileDevice = true; equal(controller.get("showMobileToggle"), true); }); test("showMoblieToggle returns false when mobile theme is disabled in site settings", function() { Discourse.SiteSettings.enable_mobile_theme = false; + Discourse.Mobile.isMobileDevice = true; equal(controller.get("showMobileToggle"), false); }); diff --git a/test/javascripts/integration/header_test.js b/test/javascripts/integration/header_test.js index fbecf25e985..58f03a3f91d 100644 --- a/test/javascripts/integration/header_test.js +++ b/test/javascripts/integration/header_test.js @@ -85,7 +85,7 @@ test("notifications dropdown", function() { }); test("sitemap dropdown", function() { - expect(8); + expect(7); Discourse.SiteSettings.faq_url = "faq-url"; Discourse.SiteSettings.enable_mobile_theme = true; @@ -117,7 +117,6 @@ test("sitemap dropdown", function() { ok(exists($siteMapDropdown.find(".admin-link")), "has showing / hiding admin links correctly bound"); ok(exists($siteMapDropdown.find(".flagged-posts.badge-notification")), "has displaying flagged posts badge correctly bound"); equal($siteMapDropdown.find(".faq-link").attr("href"), "faq-url", "is correctly bound to the FAQ url site config"); - notEqual($siteMapDropdown.find(".mobile-toggle-link").text().indexOf("mobile_view"), -1, "has displaying mobile theme toggle link correctly bound"); ok(exists($siteMapDropdown.find(".category-links")), "has categories correctly bound"); ok(exists($siteMapDropdown.find(".new-posts")), "has displaying category badges correctly bound");