diff --git a/Changelog.md b/Changelog.md index 1146ce99f89c05e5583459379993f3bfef2eb431..18728e2414cc8103ae3ca3395e67ac211e5d52e3 100644 --- a/Changelog.md +++ b/Changelog.md @@ -14,6 +14,7 @@ * 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) * 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 diff --git a/app/assets/javascripts/app/router.js b/app/assets/javascripts/app/router.js index 43befff7a59795ff05677fce190147dc8302a967..824252046dfdb5ae6e95a6cfbfaa3d811fca3172 100644 --- a/app/assets/javascripts/app/router.js +++ b/app/assets/javascripts/app/router.js @@ -24,6 +24,7 @@ app.Router = Backbone.Router.extend({ "commented": "stream", "liked": "stream", "mentions": "stream", + "public": "stream", "followed_tags": "followed_tags", "tags/:name": "followed_tags", "people/:id/photos": "photos", diff --git a/app/controllers/streams_controller.rb b/app/controllers/streams_controller.rb index 52edbe5ec2129630938da978d31c1780329c21e5..f8e8b422f3759cc092285c6c4b285cd878f884ae 100644 --- a/app/controllers/streams_controller.rb +++ b/app/controllers/streams_controller.rb @@ -5,7 +5,6 @@ class StreamsController < ApplicationController before_action :authenticate_user! before_action :save_selected_aspects, :only => :aspects - before_action :redirect_unless_admin, :only => :public layout proc { request.format == :mobile ? "application" : "with_header" } diff --git a/app/views/streams/main_stream.html.haml b/app/views/streams/main_stream.html.haml index a3c7fccb638127c6e1b5e0402776dbfa0dab5da4..f4d963ea6f0465e0434b14673847093a7b7235f0 100644 --- a/app/views/streams/main_stream.html.haml +++ b/app/views/streams/main_stream.html.haml @@ -39,6 +39,8 @@ = render "aspects/aspect_listings", stream: @stream %li = render "tags/followed_tags_listings" + %li{data: {stream: "public"}} + = link_to t("streams.public.title"), public_stream_path, rel: "backbone", class: "hoverable" .span6 #aspect_stream_container.stream_container diff --git a/features/desktop/public_stream.feature b/features/desktop/public_stream.feature new file mode 100644 index 0000000000000000000000000000000000000000..7d9c27f5dccd4fe7740abfe8fc720f2e6906c1b1 --- /dev/null +++ b/features/desktop/public_stream.feature @@ -0,0 +1,30 @@ +@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" diff --git a/spec/controllers/streams_controller_spec.rb b/spec/controllers/streams_controller_spec.rb index 05440948f052af0f6e2a2f33a0cf71c2baeb30bc..9aeb5f3194f0692effb653fc377366c92e5aec80 100644 --- a/spec/controllers/streams_controller_spec.rb +++ b/spec/controllers/streams_controller_spec.rb @@ -10,16 +10,10 @@ describe StreamsController, :type => :controller do end describe "#public" do - it 'will succeed if admin' do - Role.add_admin(alice.person) + it "succeeds" do get :public expect(response).to be_success end - - it 'will redirect if not' do - get :public - expect(response).to be_redirect - end end describe '#multi' do