Skip to content

Commit 228f385

Browse files
committed
Merge branch 'stable' into develop
2 parents 7bc2c92 + 995ce18 commit 228f385

File tree

4 files changed

+79
-1
lines changed

4 files changed

+79
-1
lines changed

Changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ With the port to Bootstrap 3, app/views/terms/default.haml has a new structure.
9191
* Redirect to sign in page when a background request fails with 401 [#6496](https://github.com/diaspora/diaspora/pull/6496)
9292
* Correctly skip setting sidekiq logfile on Heroku [#6500](https://github.com/diaspora/diaspora/pull/6500)
9393
* Fix notifications for interactions by non-contacts [#6498](https://github.com/diaspora/diaspora/pull/6498)
94+
* Fix issue where the publisher was broken on profile pages [#6503](https://github.com/diaspora/diaspora/pull/6503)
9495

9596
## Features
9697

app/views/people/show.html.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
2424
.stream_container
2525

26-
-if user_signed_in? && current_page?(person_path(current_user.person))
26+
- if user_signed_in? && current_user.person == @person
2727
= render 'publisher/publisher', publisher_aspects_for(nil)
2828

2929
.stream.clearfix#main_stream

spec/integration/profile_spec.rb

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
require "spec_helper"
2+
require "requests_helper"
3+
4+
describe PeopleController, type: :request do
5+
context "for the current user" do
6+
before do
7+
login alice
8+
end
9+
10+
it "displays the publisher for user profile path" do
11+
get "/u/#{alice.username}"
12+
13+
expect(response.status).to eq(200)
14+
# make sure we are signed in
15+
expect(response.body).not_to match(/a class="login"/)
16+
expect(response.body).to match(/div id='publisher_textarea_wrapper'/)
17+
end
18+
19+
it "displays the publisher for people path" do
20+
get "/people/#{alice.person.guid}"
21+
22+
expect(response.status).to eq(200)
23+
# make sure we are signed in
24+
expect(response.body).not_to match(/a class="login"/)
25+
expect(response.body).to match(/div id='publisher_textarea_wrapper'/)
26+
end
27+
end
28+
29+
context "for another user" do
30+
before do
31+
login bob
32+
end
33+
34+
it "doesn't display the publisher for user profile path" do
35+
get "/u/#{alice.username}"
36+
37+
expect(response.status).to eq(200)
38+
# make sure we are signed in
39+
expect(response.body).not_to match(/a class="login"/)
40+
expect(response.body).not_to match(/div id='publisher_textarea_wrapper'/)
41+
end
42+
43+
it "doesn't display the publisher for people path" do
44+
get "/people/#{alice.person.guid}"
45+
46+
expect(response.status).to eq(200)
47+
# make sure we are signed in
48+
expect(response.body).not_to match(/a class="login"/)
49+
expect(response.body).not_to match(/div id='publisher_textarea_wrapper'/)
50+
end
51+
end
52+
53+
context "with no user signed in" do
54+
it "doesn't display the publisher for user profile path" do
55+
get "/u/#{alice.username}"
56+
57+
expect(response.status).to eq(200)
58+
# make sure we aren't signed in
59+
expect(response.body).to match(/a class="login"/)
60+
expect(response.body).not_to match(/div id='publisher_textarea_wrapper'/)
61+
end
62+
63+
it "doesn't display the publisher for people path" do
64+
get "/people/#{alice.person.guid}"
65+
66+
expect(response.status).to eq(200)
67+
# make sure we aren't signed in
68+
expect(response.body).to match(/a class="login"/)
69+
expect(response.body).not_to match(/div id='publisher_textarea_wrapper'/)
70+
end
71+
end
72+
end

spec/requests_helper.rb

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include Warden::Test::Helpers
2+
3+
def login(user)
4+
login_as user, scope: :user
5+
end

0 commit comments

Comments
 (0)