Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed specs.

  • Loading branch information...
commit 81b8cefe7322872fcebe478e206dede36ef44aa6 1 parent c624571
authored February 07, 2012
5  generators/jelly/templates/javascripts/jelly.js
@@ -163,7 +163,10 @@
163 163
 
164 164
     Location: {
165 165
       on_redirect: function(location) {
166  
-        top.location.href = location;
  166
+        this.Window().top.location.href = location;
  167
+      },
  168
+      window: function() {
  169
+        return window;
167 170
       }
168 171
     }
169 172
   });
3  spec/javascript/jelly_spec.js
@@ -641,7 +641,8 @@ describe("Jelly.Location", function() {
641 641
 
642 642
   describe(".on_redirect", function() {
643 643
     it("sets top.location.href to the given location", function() {
644  
-      window.top = {location: {}};
  644
+      var window = {top: {location: {}}}
  645
+      spyOn(Jelly.Location, "window").andReturn(window);
645 646
       Jelly.Location.on_redirect("http://mars.com");
646 647
       expect(window.top.location.href).toEqual("http://mars.com");
647 648
     });

0 notes on commit 81b8cef

Please sign in to comment.
Something went wrong with that request. Please try again.