From 848e5d2a572890ef73d27675bb5eee06a778f730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Thu, 16 May 2013 23:16:15 +0200 Subject: [PATCH] try to fix Jasmine failure on CI by not overwriting app.views.Location in spec --- spec/javascripts/app/views/publisher_view_spec.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/javascripts/app/views/publisher_view_spec.js b/spec/javascripts/app/views/publisher_view_spec.js index 5c9b0866a..a8fad7b66 100644 --- a/spec/javascripts/app/views/publisher_view_spec.js +++ b/spec/javascripts/app/views/publisher_view_spec.js @@ -329,6 +329,9 @@ describe("app.views.Publisher", function() { // inserts location to the DOM; it is the location's view element setFixtures('
'); + //Backup original view + var original_location = app.views.Location; + // creates a new Location view with the #location element app.views.Location = new Backbone.View({el:"#location"}); @@ -337,7 +340,11 @@ describe("app.views.Publisher", function() { // calls the destroy function and test the expected result this.view.destroyLocation(); + expect($("#location").length).toBe(0); + + //Restore view + app.views.Location = original_location; }) });