[openstreetmap/openstreetmap-website] Show deleted diaries and diary comments to admins (#2248)
Tom Hughes
notifications at github.com
Wed Jun 5 16:27:56 UTC 2019
tomhughes commented on this pull request.
> @@ -85,6 +85,10 @@ def test_routes
{ :path => "/user/username/diary/1/hide", :method => :post },
{ :controller => "diary_entries", :action => "hide", :display_name => "username", :id => "1" }
)
+ assert_routing(
+ { :path => "/user/username/diary/1/unhide", :method => :post },
+ { :controller => "diary_entries", :action => "unhide", :display_name => "username", :id => "1" }
+ )
Shouldn't there be a routing test for `unhidecomment` as well?
> + sign_in_as(create(:administrator_user))
+ visit diary_entries_path
+
+ assert_not page.has_content? @deleted_entry.title
+ end
+
+ test "deleted diary comments should be hidden for regular users" do
+ @deleted_comment = create(:diary_comment, :diary_entry => @diary_entry, :visible => false)
+
+ sign_in_as(create(:user))
+ visit diary_entry_path(@diary_entry.user, @diary_entry)
+
+ assert_not page.has_content? @deleted_comment.body
+ end
+
+ test "deleted diary comments should be show to administrators" do
I assume `show` should be `shown` here...
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2248#pullrequestreview-246119162
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20190605/1213332c/attachment-0001.html>
More information about the rails-dev
mailing list