Skip to content

Commit

Permalink
Fixed specs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Takita committed Feb 7, 2012
1 parent c624571 commit 81b8cef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion generators/jelly/templates/javascripts/jelly.js
Expand Up @@ -163,7 +163,10 @@

Location: {
on_redirect: function(location) {
top.location.href = location;
this.Window().top.location.href = location;
},
window: function() {
return window;
}
}
});
Expand Down
3 changes: 2 additions & 1 deletion spec/javascript/jelly_spec.js
Expand Up @@ -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");
});
Expand Down

0 comments on commit 81b8cef

Please sign in to comment.