From a396a246ee53c206383f9527a91dae74db8381b5 Mon Sep 17 00:00:00 2001 From: Benjamin Neff <benjamin@coding4coffee.ch> Date: Mon, 18 May 2015 03:23:54 +0200 Subject: [PATCH] remove unused hasPhotos and hasText functions - added in a836b06d3e85acaea1d6a4c3d7eaaec47f48d561 - removed in 49ea8c856342ec9e6085a7c5915b6e97e1b8627c closes #5969 --- Changelog.md | 1 + app/assets/javascripts/app/models/post.js | 8 -------- spec/javascripts/app/models/post_spec.js | 24 ----------------------- 3 files changed, 1 insertion(+), 32 deletions(-) diff --git a/Changelog.md b/Changelog.md index 1127b8c05d..f6ba74c6b0 100644 --- a/Changelog.md +++ b/Changelog.md @@ -8,6 +8,7 @@ * 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) * 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 * Disable auto follow back on aspect deletion [#5846](https://github.com/diaspora/diaspora/pull/5846) diff --git a/app/assets/javascripts/app/models/post.js b/app/assets/javascripts/app/models/post.js index 30da8f71c3..8335f5a0d6 100644 --- a/app/assets/javascripts/app/models/post.js +++ b/app/assets/javascripts/app/models/post.js @@ -61,14 +61,6 @@ app.models.Post = Backbone.Model.extend(_.extend({}, app.models.formatDateMixin, preloadOrFetch : function(){ var action = app.hasPreload("post") ? this.set(app.parsePreload("post")) : this.fetch(); return $.when(action); - }, - - hasPhotos : function(){ - return this.get("photos") && this.get("photos").length > 0; - }, - - hasText : function(){ - return $.trim(this.get("text")) !== ""; } })); // @license-end diff --git a/spec/javascripts/app/models/post_spec.js b/spec/javascripts/app/models/post_spec.js index b644e26be0..dc03245a3b 100644 --- a/spec/javascripts/app/models/post_spec.js +++ b/spec/javascripts/app/models/post_spec.js @@ -36,28 +36,4 @@ describe("app.models.Post", function() { 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(); - }); - }); }); -- GitLab