From 1a2365857842474ca2ead49ee393d525d4ae213c Mon Sep 17 00:00:00 2001
From: Ben Halpern
Date: Wed, 9 May 2018 17:05:29 -0400
Subject: [PATCH 1/2] Update FAQ with info about comment threads (#298)
* Update FAQ with info about comment threads
Also removed scholarship info, seems less relevant these days.
* Fix grammar
---
app/views/pages/faq.html.erb | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/app/views/pages/faq.html.erb b/app/views/pages/faq.html.erb
index 07215a798..52fbffcf6 100644
--- a/app/views/pages/faq.html.erb
+++ b/app/views/pages/faq.html.erb
@@ -107,6 +107,11 @@
Include `cover_image: [url]` in the front matter of your post. For more information on our editor, check out our editor guide.
+
+ How does comment threading work?
+
+ Comments are threaded with a maximum depth, and then they become flat. You can respond to flattened-out threads by replying to the last comment in the overall thread.
+
I heard you were planning on open sourcing the code. Is that ever going to happen?
@@ -126,7 +131,7 @@
We mail out the sticker packs separately from the shirts. Please be patient! If you don't recieve the stickers within three weeks (domestic) or six weeks (international), e-mail members@dev.to for help.
- How do I cancel my membership?
+ How do I cancel my sustaining membership?
Go to your settings page and click 'cancel membership'.
+ Negative reactions are private. Use the :thumbsdown: to move something "down" for any reason. The :vomit: is for clear code of conduct violations.
+
+
+
+
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index 2562a0c8d..70bd64247 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -220,6 +220,7 @@ Rails.application.routes.draw do
get "/:timeframe" => "stories#index", constraints: { timeframe: /latest/}
+ #Lagacy comment format (might still be floating around app, and external links)
get "/:username/:slug/comments/new/:parent_id_code" => "comments#new"
get "/:username/:slug/comments/new" => "comments#new"
get "/:username/:slug/comments" => "comments#index"
@@ -227,11 +228,15 @@ Rails.application.routes.draw do
get "/:username/:slug/comments/:id_code/edit" => "comments#edit"
get "/:username/:slug/comments/:id_code/delete_confirm" => "comments#delete_confirm"
+ #Proper link format
get "/:username/comment/:id_code" => "comments#index"
get "/:username/comment/:id_code/edit" => "comments#edit"
get "/:username/comment/:id_code/delete_confirm" => "comments#delete_confirm"
+ get "/:username/comment/:id_code/mod" => "moderations#comment"
+
get "/:username/:slug/:view" => "stories#show", constraints: { view: /moderate/}
+ get "/:username/:slug/mod" => "moderations#article"
get "/:username/:slug/edit" => "articles#edit"
get "/:username/:slug/delete_confirm" => "articles#delete_confirm"
get "/:username/:view" => "stories#index", constraints: { view: /comments|moderate|admin/}
diff --git a/spec/requests/moderations_spec.rb b/spec/requests/moderations_spec.rb
new file mode 100644
index 000000000..f1bb5d406
--- /dev/null
+++ b/spec/requests/moderations_spec.rb
@@ -0,0 +1,42 @@
+require "rails_helper"
+
+RSpec.describe "Moderations", type: :request do
+ let(:user) { create(:user) }
+ let(:article) { create(:article, user_id: user.id) }
+ let(:comment) do
+ create(:comment,
+ commentable_id: article.id,
+ commentable_type: "Article",
+ user_id: user.id)
+ end
+
+ before do
+ sign_in user
+ end
+
+ describe "GET moderations article" do
+ it "returns 200 if user trusted" do
+ user.add_role :trusted
+ get article.path + "/mod"
+ expect(response).to have_http_status(200)
+ end
+ it "returns 404 if user trusted not trusted" do
+ expect do
+ get article.path + "/mod"
+ end.to raise_error(ActionController::RoutingError)
+ end
+ end
+
+ describe "GET moderations comment" do
+ it "returns 200 if user trusted" do
+ user.add_role :trusted
+ get comment.path + "/mod"
+ expect(response).to have_http_status(200)
+ end
+ it "returns 404 if user trusted not trusted" do
+ expect do
+ get comment.path + "/mod"
+ end.to raise_error(ActionController::RoutingError)
+ end
+ end
+end
\ No newline at end of file