Merge branch 'release/0.7.0.0' into next-minor
This commit is contained in:
commit
685135474b
3 changed files with 11 additions and 6 deletions
|
|
@ -17,15 +17,14 @@ app.views.Content = app.views.Base.extend({
|
||||||
|
|
||||||
largePhoto : function() {
|
largePhoto : function() {
|
||||||
var photos = this.model.get("photos");
|
var photos = this.model.get("photos");
|
||||||
if(!photos || photos.length === 0) { return }
|
if (!photos || photos.length === 0) { return false; }
|
||||||
return photos[0];
|
return photos[0];
|
||||||
},
|
},
|
||||||
|
|
||||||
smallPhotos : function() {
|
smallPhotos : function() {
|
||||||
var photos = this.model.get("photos");
|
var photos = this.model.get("photos");
|
||||||
if(!photos || photos.length < 2) { return }
|
if (!photos || photos.length < 2) { return false; }
|
||||||
photos.splice(0, 1); // remove first photo as it is already shown as largePhoto
|
return photos.slice(1); // remove first photo as it is already shown as largePhoto
|
||||||
return photos;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
expandPost: function(evt) {
|
expandPost: function(evt) {
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,17 @@ describe("app.views.Content", function(){
|
||||||
this.view = new app.views.Content({model : this.post});
|
this.view = new app.views.Content({model : this.post});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("rendering", function(){
|
describe("smallPhotos", function() {
|
||||||
it("should return all but the first photo from the post", function() {
|
it("should return all but the first photo from the post", function() {
|
||||||
this.post.set({photos : [1,2]}); // set 2 Photos
|
this.post.set({photos : [1,2]}); // set 2 Photos
|
||||||
expect(this.view.smallPhotos().length).toEqual(1);
|
expect(this.view.smallPhotos().length).toEqual(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("shouldn't change the photos array", function() {
|
||||||
|
this.post.set({photos: [1, 2]}); // set 2 Photos
|
||||||
|
this.view.smallPhotos();
|
||||||
|
expect(this.post.get("photos").length).toEqual(2);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("presenter", function(){
|
describe("presenter", function(){
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ describe Notifications::Mentioned do
|
||||||
|
|
||||||
it "calls filter_mentions on self" do
|
it "calls filter_mentions on self" do
|
||||||
expect(TestNotification).to receive(:filter_mentions).with(
|
expect(TestNotification).to receive(:filter_mentions).with(
|
||||||
Mention.where(mentions_container: status_message, person: [alice, bob].map(&:person)),
|
match_array(Mention.where(mentions_container: status_message, person: [alice, bob].map(&:person))),
|
||||||
status_message,
|
status_message,
|
||||||
[alice.id, bob.id]
|
[alice.id, bob.id]
|
||||||
).and_return([])
|
).and_return([])
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue