diff --git a/spec/javascripts/app/models/post/interacations_spec.js b/spec/javascripts/app/models/post/interacations_spec.js index 599929eca..5e318b4e3 100644 --- a/spec/javascripts/app/models/post/interacations_spec.js +++ b/spec/javascripts/app/models/post/interacations_spec.js @@ -122,9 +122,11 @@ describe("app.models.Post.Interactions", function(){ }); it("adds the reshare to the default, activity and aspects stream", function() { - app.stream = { addNow: $.noop }; + app.stream = new app.models.Stream(_, { basePath: "/aspects/all" }); + spyOn(app.stream, "addNow"); var self = this; + ["/stream", "/activity", "/aspects"].forEach(function(path) { app.stream.basePath = function() { return path; }; self.interactions.reshare(); @@ -132,10 +134,13 @@ describe("app.models.Post.Interactions", function(){ expect(app.stream.addNow).toHaveBeenCalledWith({id: 1}); }); + + new app.models.Stream(_, { basePath: "/aspects/all" }); }); it("doesn't add the reshare to any other stream", function() { - app.stream = { addNow: $.noop }; + app.stream = new app.models.Stream(_, { basePath: "/aspects/all" }); + spyOn(app.stream, "addNow"); var self = this; ["/followed_tags", "/mentions/", "/tag/diaspora", "/people/guid/stream"].forEach(function(path) { @@ -144,6 +149,8 @@ describe("app.models.Post.Interactions", function(){ jasmine.Ajax.requests.mostRecent().respondWith(ajaxSuccess); expect(app.stream.addNow).not.toHaveBeenCalled(); }); + + new app.models.Stream(_, { basePath: "/aspects/all" }); }); it("sets the participation flag for the post", function() { diff --git a/spec/javascripts/app/views/publisher_view_spec.js b/spec/javascripts/app/views/publisher_view_spec.js index a43d12a76..305e547e0 100644 --- a/spec/javascripts/app/views/publisher_view_spec.js +++ b/spec/javascripts/app/views/publisher_view_spec.js @@ -25,7 +25,8 @@ describe("app.views.Publisher", function() { describe("createStatusMessage", function(){ it("doesn't add the status message to the stream", function() { - app.stream = { addNow: $.noop }; + app.stream = new app.models.Stream(); + spyOn(app.stream, "addNow"); this.view.createStatusMessage($.Event()); jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, responseText: "{\"id\": 1}" }); @@ -198,7 +199,8 @@ describe("app.views.Publisher", function() { describe("createStatusMessage", function(){ it("adds the status message to the stream", function() { - app.stream = { addNow: $.noop }; + new app.models.Stream(); + spyOn(app.stream, "addNow"); this.view.createStatusMessage($.Event()); jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, responseText: "{\"id\": 1}" });