Merge branch 'stable' into develop

This commit is contained in:
Jonne Haß 2015-08-06 22:56:30 +02:00
commit 480384a077
4 changed files with 23 additions and 0 deletions

View file

@ -79,6 +79,7 @@ With the port to Bootstrap 3, app/views/terms/default.haml has a new structure.
* Fix mobile photos index page [#6243](https://github.com/diaspora/diaspora/pull/6243)
* Fix conversations view with no contacts [#6266](https://github.com/diaspora/diaspora/pull/6266)
* Links in the left sidebar are now clickable on full width [#6267](https://github.com/diaspora/diaspora/pull/6267)
* Guard against passing nil into person\_image\_tag [#6286](https://github.com/diaspora/diaspora/pull/6286)
## Features

View file

@ -32,6 +32,7 @@ module PeopleHelper
end
def person_image_tag(person, size = :thumb_small)
return "" if person.nil? || person.profile.nil?
image_tag(person.profile.image_url(size), alt: person.name, class: "avatar img-responsive center-block",
title: person.name, "data-person_id" => person.id)
end

View file

@ -117,6 +117,24 @@ describe NotificationsController, :type => :controller do
expect(assigns[:notifications].count).to eq(1)
end
end
context "after deleting a person" do
before do
user = FactoryGirl.create(:user_with_aspect)
user.share_with(alice.person, user.aspects.first)
user.person.delete
end
it "succeeds" do
get :index
expect(response).to be_success
end
it "succeeds on mobile" do
get :index, format: :mobile
expect(response).to be_success
end
end
end
describe "#read_all" do

View file

@ -23,6 +23,9 @@ describe PeopleHelper, :type => :helper do
end
describe "#person_image_tag" do
it "returns an empty string if person is nil" do
expect(person_image_tag(nil)).to eq("")
end
it "should not allow basic XSS/HTML" do
@person.profile.first_name = "I'm <h1>Evil"
@person.profile.last_name = "I'm <h1>Evil"