Skip to content
Extraits de code Groupes Projets
Valider e0be1b49 rédigé par Steffen van Bergerem's avatar Steffen van Bergerem Validation de Jonne Haß
Parcourir les fichiers

Add public stream

closes #6465
parent 058bcb43
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
* Only post to the primary tumblr blog [#6386](https://github.com/diaspora/diaspora/pull/6386) * Only post to the primary tumblr blog [#6386](https://github.com/diaspora/diaspora/pull/6386)
* Always show public photos on profile page [#6398](https://github.com/diaspora/diaspora/pull/6398) * Always show public photos on profile page [#6398](https://github.com/diaspora/diaspora/pull/6398)
* Expose Unicorn's pid option to our configuration system [#6411](https://github.com/diaspora/diaspora/pull/6411) * Expose Unicorn's pid option to our configuration system [#6411](https://github.com/diaspora/diaspora/pull/6411)
* Add stream of all public posts [#6465](https://github.com/diaspora/diaspora/pull/6465)
# 0.5.3.1 # 0.5.3.1
......
...@@ -24,6 +24,7 @@ app.Router = Backbone.Router.extend({ ...@@ -24,6 +24,7 @@ app.Router = Backbone.Router.extend({
"commented": "stream", "commented": "stream",
"liked": "stream", "liked": "stream",
"mentions": "stream", "mentions": "stream",
"public": "stream",
"followed_tags": "followed_tags", "followed_tags": "followed_tags",
"tags/:name": "followed_tags", "tags/:name": "followed_tags",
"people/:id/photos": "photos", "people/:id/photos": "photos",
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
class StreamsController < ApplicationController class StreamsController < ApplicationController
before_action :authenticate_user! before_action :authenticate_user!
before_action :save_selected_aspects, :only => :aspects before_action :save_selected_aspects, :only => :aspects
before_action :redirect_unless_admin, :only => :public
layout proc { request.format == :mobile ? "application" : "with_header" } layout proc { request.format == :mobile ? "application" : "with_header" }
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
= render "aspects/aspect_listings", stream: @stream = render "aspects/aspect_listings", stream: @stream
%li %li
= render "tags/followed_tags_listings" = render "tags/followed_tags_listings"
%li{data: {stream: "public"}}
= link_to t("streams.public.title"), public_stream_path, rel: "backbone", class: "hoverable"
.span6 .span6
#aspect_stream_container.stream_container #aspect_stream_container.stream_container
......
@javascript
Feature: The public stream
Background:
Given following users exist:
| username | email |
| Alice Smith | alice@alice.alice |
| Bob Jones | bob@bob.bob |
| Eve Doe | eve@eve.eve |
And a user with email "alice@alice.alice" is connected with "bob@bob.bob"
And "bob@bob.bob" has a public post with text "Bob’s public post"
And "bob@bob.bob" has a non public post with text "Bob’s private post"
And "eve@eve.eve" has a public post with text "Eve’s public post"
Scenario: seeing public posts of someone you don't follow
When I sign in as "alice@alice.alice"
Then I should not see "Eve’s public post"
When I am on the public stream page
Then I should see "Eve’s public post"
Scenario: seeing public posts of someone you follow
When I sign in as "alice@alice.alice"
Then I should see "Bob’s public post"
When I am on the public stream page
Then I should see "Bob’s public post"
Scenario: not seeing private posts of someone you follow
When I sign in as "alice@alice.alice"
Then I should see "Bob’s private post"
When I am on the public stream page
Then I should not see "Bob’s private post"
...@@ -10,16 +10,10 @@ describe StreamsController, :type => :controller do ...@@ -10,16 +10,10 @@ describe StreamsController, :type => :controller do
end end
describe "#public" do describe "#public" do
it 'will succeed if admin' do it "succeeds" do
Role.add_admin(alice.person)
get :public get :public
expect(response).to be_success expect(response).to be_success
end end
it 'will redirect if not' do
get :public
expect(response).to be_redirect
end
end end
describe '#multi' do describe '#multi' do
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter