Merge branch 'next-minor' into develop
This commit is contained in:
commit
97805e6602
3 changed files with 10 additions and 2 deletions
|
|
@ -17,6 +17,7 @@
|
||||||
## Refactor
|
## Refactor
|
||||||
|
|
||||||
## Bug fixes
|
## Bug fixes
|
||||||
|
* Fix incorrect post sorting on tag streams and tag searches for tags containing the word "activity" [#7422](https://github.com/diaspora/diaspora/issues/7422)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ app.models.Stream = Backbone.Collection.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
sortOrder : function() {
|
sortOrder : function() {
|
||||||
return /activity/.test(this.basePath()) ? "interactedAt" : "createdAt";
|
return /^\/activity/.test(this.basePath()) ? "interactedAt" : "createdAt";
|
||||||
},
|
},
|
||||||
|
|
||||||
/* This function is for adding a large number of posts one by one.
|
/* This function is for adding a large number of posts one by one.
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ describe("app.models.Stream", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("returns a comparator for posts that compares interacted_at and ids for the activity stream", function() {
|
it("returns a comparator for posts that compares interacted_at and ids for the activity stream", function() {
|
||||||
spyOn(stream, "basePath").and.returnValue("activity");
|
spyOn(stream, "basePath").and.returnValue("/activity");
|
||||||
this.options = stream.collectionOptions();
|
this.options = stream.collectionOptions();
|
||||||
expect(this.options.comparator(this.post1, this.post2)).toBe(1);
|
expect(this.options.comparator(this.post1, this.post2)).toBe(1);
|
||||||
expect(this.options.comparator(this.post2, this.post1)).toBe(-1);
|
expect(this.options.comparator(this.post2, this.post1)).toBe(-1);
|
||||||
|
|
@ -37,6 +37,13 @@ describe("app.models.Stream", function() {
|
||||||
expect(this.options.comparator(this.post4, this.post1)).toBe(1);
|
expect(this.options.comparator(this.post4, this.post1)).toBe(1);
|
||||||
expect(this.options.comparator(this.post1, this.post1)).toBe(0);
|
expect(this.options.comparator(this.post1, this.post1)).toBe(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("returns a comparator for posts that compares created_at and ids for tags including 'activity'", function() {
|
||||||
|
spyOn(stream, "basePath").and.returnValue("/tags/foo-activity-bar");
|
||||||
|
this.options = stream.collectionOptions();
|
||||||
|
expect(this.options.comparator(this.post2, this.post3)).toBe(1);
|
||||||
|
expect(this.options.comparator(this.post3, this.post2)).toBe(-1);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("#_fetchOpts", function() {
|
describe("#_fetchOpts", function() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue