diff --git a/Changelog.md b/Changelog.md index cd59ef273..ff734c8f2 100644 --- a/Changelog.md +++ b/Changelog.md @@ -9,6 +9,7 @@ * Don't use Pathname early to circumvent some rare initialization errors [#3816](https://github.com/diaspora/diaspora/issues/3816) * Don't error out in script/server if git is unavailable. +* Fix post preview from tag pages [#4157](https://github.com/diaspora/diaspora/issues/4157) ## Features diff --git a/app/assets/javascripts/app/views/publisher_view.js b/app/assets/javascripts/app/views/publisher_view.js index 28368ec51..639b66c85 100644 --- a/app/assets/javascripts/app/views/publisher_view.js +++ b/app/assets/javascripts/app/views/publisher_view.js @@ -187,7 +187,7 @@ app.views.Publisher = Backbone.View.extend(_.extend( this.removePostPreview(); app.stream.items.add(previewMessage); this.recentPreview=previewMessage; - this.modifyPostPreview($('.stream_element:first')); + this.modifyPostPreview($('.stream_element:first',$('.stream_container'))); } }, diff --git a/features/post_preview.feature b/features/post_preview.feature index 1f11cadab..49e9c0048 100644 --- a/features/post_preview.feature +++ b/features/post_preview.feature @@ -50,3 +50,15 @@ Feature: preview posts in the stream And I press "Preview" And I follow "Alice Smith" Then I should see "Alice Smith" + + Scenario: preview a post on tag page + Given there is a user "Samuel Beckett" who's tagged "#rockstar" + When I search for "#rockstar" + Then I should be on the tag page for "rockstar" + And I should see "Samuel Beckett" + Given I expand the publisher + When I fill in the following: + | status_message_fake_text | This preview rocks | + And I press "Preview" + Then "This preview rocks" should be post 1 + And the first post should be a preview