Merge branch 'stable' into develop
This commit is contained in:
commit
3446cb2f3f
3 changed files with 1 additions and 32 deletions
|
|
@ -23,6 +23,7 @@ Ruby 2.0 is no longer officially supported.
|
||||||
* Improve invoking mobile site in the testsuite [#5915](https://github.com/diaspora/diaspora/pull/5915)
|
* Improve invoking mobile site in the testsuite [#5915](https://github.com/diaspora/diaspora/pull/5915)
|
||||||
* Do not retry a couple of unrecoverable job failures [#5938](https://github.com/diaspora/diaspora/pull/5938) [#5942](https://github.com/diaspora/diaspora/pull/5943)
|
* Do not retry a couple of unrecoverable job failures [#5938](https://github.com/diaspora/diaspora/pull/5938) [#5942](https://github.com/diaspora/diaspora/pull/5943)
|
||||||
* Remove some old temporary workarounds [#5964](https://github.com/diaspora/diaspora/pull/5964)
|
* Remove some old temporary workarounds [#5964](https://github.com/diaspora/diaspora/pull/5964)
|
||||||
|
* Remove unused `hasPhotos` and `hasText` functions [#5969](https://github.com/diaspora/diaspora/pull/5969)
|
||||||
|
|
||||||
## Bug fixes
|
## Bug fixes
|
||||||
* Disable auto follow back on aspect deletion [#5846](https://github.com/diaspora/diaspora/pull/5846)
|
* Disable auto follow back on aspect deletion [#5846](https://github.com/diaspora/diaspora/pull/5846)
|
||||||
|
|
|
||||||
|
|
@ -61,14 +61,6 @@ app.models.Post = Backbone.Model.extend(_.extend({}, app.models.formatDateMixin,
|
||||||
preloadOrFetch : function(){
|
preloadOrFetch : function(){
|
||||||
var action = app.hasPreload("post") ? this.set(app.parsePreload("post")) : this.fetch();
|
var action = app.hasPreload("post") ? this.set(app.parsePreload("post")) : this.fetch();
|
||||||
return $.when(action);
|
return $.when(action);
|
||||||
},
|
|
||||||
|
|
||||||
hasPhotos : function(){
|
|
||||||
return this.get("photos") && this.get("photos").length > 0;
|
|
||||||
},
|
|
||||||
|
|
||||||
hasText : function(){
|
|
||||||
return $.trim(this.get("text")) !== "";
|
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
// @license-end
|
// @license-end
|
||||||
|
|
|
||||||
|
|
@ -36,28 +36,4 @@ describe("app.models.Post", function() {
|
||||||
expect(this.post.createdAt()).toEqual(+date);
|
expect(this.post.createdAt()).toEqual(+date);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("hasPhotos", function(){
|
|
||||||
it('returns true if the model has more than one photo', function(){
|
|
||||||
this.post.set({photos : [1,2]});
|
|
||||||
expect(this.post.hasPhotos()).toBeTruthy();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('returns false if the model does not have any photos', function(){
|
|
||||||
this.post.set({photos : []});
|
|
||||||
expect(this.post.hasPhotos()).toBeFalsy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("hasText", function(){
|
|
||||||
it('returns true if the model has text', function(){
|
|
||||||
this.post.set({text : "hella"});
|
|
||||||
expect(this.post.hasText()).toBeTruthy();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('returns false if the model does not have text', function(){
|
|
||||||
this.post.set({text : " "});
|
|
||||||
expect(this.post.hasText()).toBeFalsy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue