Permalink
Browse files

Fixed specs.

  • Loading branch information...
1 parent c624571 commit 81b8cefe7322872fcebe478e206dede36ef44aa6 Brian Takita committed Feb 7, 2012
Showing with 6 additions and 2 deletions.
  1. +4 −1 generators/jelly/templates/javascripts/jelly.js
  2. +2 −1 spec/javascript/jelly_spec.js
View
5 generators/jelly/templates/javascripts/jelly.js
@@ -163,7 +163,10 @@
Location: {
on_redirect: function(location) {
- top.location.href = location;
+ this.Window().top.location.href = location;
+ },
+ window: function() {
+ return window;
}
}
});
View
3 spec/javascript/jelly_spec.js
@@ -641,7 +641,8 @@ describe("Jelly.Location", function() {
describe(".on_redirect", function() {
it("sets top.location.href to the given location", function() {
- window.top = {location: {}};
+ var window = {top: {location: {}}}
+ spyOn(Jelly.Location, "window").andReturn(window);
Jelly.Location.on_redirect("http://mars.com");
expect(window.top.location.href).toEqual("http://mars.com");
});

0 comments on commit 81b8cef

Please sign in to comment.