Skip to content
Extraits de code Groupes Projets
Valider 099bb010 rédigé par Jonne Haß's avatar Jonne Haß
Parcourir les fichiers

Merge branch 'release/0.5.0.0-RC' into develop

parents 6e1b5397 2dd4bf0a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -161,6 +161,7 @@ diaspora* no longer adds a `div.container` to wrap custom splash pages. This add ...@@ -161,6 +161,7 @@ diaspora* no longer adds a `div.container` to wrap custom splash pages. This add
* Fix displaying reshares in the stream on mobile [#5790](https://github.com/diaspora/diaspora/pull/5790) * Fix displaying reshares in the stream on mobile [#5790](https://github.com/diaspora/diaspora/pull/5790)
* Remove bottom margin from lists that are the last element of a post. [#5721](https://github.com/diaspora/diaspora/pull/5721) * Remove bottom margin from lists that are the last element of a post. [#5721](https://github.com/diaspora/diaspora/pull/5721)
* Fix pagination design on conversations page [#5791](https://github.com/diaspora/diaspora/pull/5791) * Fix pagination design on conversations page [#5791](https://github.com/diaspora/diaspora/pull/5791)
* Prevent inserting posts into the wrong stream [#5838](https://github.com/diaspora/diaspora/pull/5838)
## Features ## Features
* Don't pull jQuery from a CDN by default [#5105](https://github.com/diaspora/diaspora/pull/5105) * Don't pull jQuery from a CDN by default [#5105](https://github.com/diaspora/diaspora/pull/5105)
......
...@@ -110,7 +110,9 @@ app.models.Post.Interactions = Backbone.Model.extend({ ...@@ -110,7 +110,9 @@ app.models.Post.Interactions = Backbone.Model.extend({
notice: Diaspora.I18n.t("reshares.successful") notice: Diaspora.I18n.t("reshares.successful")
}); });
interactions.reshares.add(reshare); interactions.reshares.add(reshare);
if (app.stream) {app.stream.addNow(reshare)} if (app.stream && /^\/(?:stream|activity|aspects)/.test(app.stream.basePath())) {
app.stream.addNow(reshare);
}
interactions.trigger("change"); interactions.trigger("change");
}) })
.fail(function(){ .fail(function(){
......
...@@ -195,7 +195,9 @@ app.views.Publisher = Backbone.View.extend({ ...@@ -195,7 +195,9 @@ app.views.Publisher = Backbone.View.extend({
self.view_poll_creator.trigger('publisher:sync'); self.view_poll_creator.trigger('publisher:sync');
} }
if(app.stream) app.stream.addNow(statusMessage.toJSON()); if(app.stream && !self.standalone){
app.stream.addNow(statusMessage.toJSON());
}
// clear state // clear state
self.clear(); self.clear();
......
...@@ -42,7 +42,7 @@ describe("app.models.Post.Interactions", function(){ ...@@ -42,7 +42,7 @@ describe("app.models.Post.Interactions", function(){
}); });
describe("reshare", function() { describe("reshare", function() {
var ajax_success = { status: 200, responseText: '{"id": 1}' }; var ajaxSuccess = { status: 200, responseText: "{\"id\": 1}" };
beforeEach(function(){ beforeEach(function(){
this.reshare = this.interactions.post.reshare(); this.reshare = this.interactions.post.reshare();
...@@ -52,18 +52,34 @@ describe("app.models.Post.Interactions", function(){ ...@@ -52,18 +52,34 @@ describe("app.models.Post.Interactions", function(){
spyOn(this.interactions, "trigger"); spyOn(this.interactions, "trigger");
this.interactions.reshare(); this.interactions.reshare();
jasmine.Ajax.requests.mostRecent().respondWith(ajax_success); jasmine.Ajax.requests.mostRecent().respondWith(ajaxSuccess);
expect(this.interactions.trigger).toHaveBeenCalledWith("change"); expect(this.interactions.trigger).toHaveBeenCalledWith("change");
}); });
it("adds the reshare to the stream", function() { it("adds the reshare to the default, activity and aspects stream", function() {
app.stream = { addNow: $.noop }; app.stream = { addNow: $.noop };
spyOn(app.stream, "addNow"); spyOn(app.stream, "addNow");
this.interactions.reshare(); var self = this;
jasmine.Ajax.requests.mostRecent().respondWith(ajax_success); ["/stream", "/activity", "/aspects"].forEach(function(path) {
app.stream.basePath = function() { return path; };
self.interactions.reshare();
jasmine.Ajax.requests.mostRecent().respondWith(ajaxSuccess);
expect(app.stream.addNow).toHaveBeenCalledWith({id: 1});
});
});
expect(app.stream.addNow).toHaveBeenCalledWith({id: 1}); it("doesn't add the reshare to any other stream", function() {
app.stream = { addNow: $.noop };
spyOn(app.stream, "addNow");
var self = this;
["/followed_tags", "/mentions/", "/tag/diaspora", "/people/guid/stream"].forEach(function(path) {
app.stream.basePath = function() { return path; };
self.interactions.reshare();
jasmine.Ajax.requests.mostRecent().respondWith(ajaxSuccess);
expect(app.stream.addNow).not.toHaveBeenCalled();
});
}); });
}); });
}); });
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
*/ */
describe("app.views.Publisher", function() { describe("app.views.Publisher", function() {
describe("standalone", function() { context("standalone", function() {
beforeEach(function() { beforeEach(function() {
// TODO should be jasmine helper // TODO should be jasmine helper
loginAs({name: "alice", avatar : {small : "http://avatar.com/photo.jpg"}}); loginAs({name: "alice", avatar : {small : "http://avatar.com/photo.jpg"}});
...@@ -22,6 +22,16 @@ describe("app.views.Publisher", function() { ...@@ -22,6 +22,16 @@ describe("app.views.Publisher", function() {
it("hides the post preview button in standalone mode", function() { it("hides the post preview button in standalone mode", function() {
expect(this.view.$('.post_preview_button').is(':visible')).toBeFalsy(); expect(this.view.$('.post_preview_button').is(':visible')).toBeFalsy();
}); });
describe("createStatusMessage", function(){
it("doesn't add the status message to the stream", function() {
app.stream = { addNow: $.noop };
spyOn(app.stream, "addNow");
this.view.createStatusMessage($.Event());
jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, responseText: "{\"id\": 1}" });
expect(app.stream.addNow).not.toHaveBeenCalled();
});
});
}); });
context("plain publisher", function() { context("plain publisher", function() {
...@@ -128,6 +138,14 @@ describe("app.views.Publisher", function() { ...@@ -128,6 +138,14 @@ describe("app.views.Publisher", function() {
this.view.createStatusMessage($.Event()); this.view.createStatusMessage($.Event());
expect(this.view.handleTextchange).toHaveBeenCalled(); expect(this.view.handleTextchange).toHaveBeenCalled();
}); });
it("adds the status message to the stream", function() {
app.stream = { addNow: $.noop };
spyOn(app.stream, "addNow");
this.view.createStatusMessage($.Event());
jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, responseText: "{\"id\": 1}" });
expect(app.stream.addNow).toHaveBeenCalled();
});
}); });
describe('#setText', function() { describe('#setText', function() {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter