app_spec fixes
This commit is contained in:
parent
c90cb3328e
commit
71e0bdc411
1 changed files with 5 additions and 1 deletions
|
|
@ -62,6 +62,10 @@ describe("app", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("setupAjaxErrorRedirect", function() {
|
describe("setupAjaxErrorRedirect", function() {
|
||||||
|
beforeEach(function() {
|
||||||
|
app.setupAjaxErrorRedirect();
|
||||||
|
});
|
||||||
|
|
||||||
it("redirects to /users/sign_in on 401 ajax responses", function() {
|
it("redirects to /users/sign_in on 401 ajax responses", function() {
|
||||||
spyOn(app, "_changeLocation");
|
spyOn(app, "_changeLocation");
|
||||||
$.ajax("/test");
|
$.ajax("/test");
|
||||||
|
|
@ -115,7 +119,6 @@ describe("app", function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
app.stream = {basePath: function() { return "/stream"; }};
|
app.stream = {basePath: function() { return "/stream"; }};
|
||||||
app.notificationsCollection = {fetch: $.noop};
|
app.notificationsCollection = {fetch: $.noop};
|
||||||
spyOn(Backbone.history, "start");
|
|
||||||
this.link = $("<a href='/backbone-link' rel='backbone'>");
|
this.link = $("<a href='/backbone-link' rel='backbone'>");
|
||||||
spec.content().append(this.link);
|
spec.content().append(this.link);
|
||||||
app.setupBackboneLinks();
|
app.setupBackboneLinks();
|
||||||
|
|
@ -123,6 +126,7 @@ describe("app", function() {
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
app.stream = undefined;
|
app.stream = undefined;
|
||||||
|
Backbone.history.stop();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("calls Backbone.history.navigate", function() {
|
it("calls Backbone.history.navigate", function() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue