diff --git a/app/views/articles/_sidebar_nav.html.erb b/app/views/articles/_sidebar_nav.html.erb
index bff0a0410..4bc446cad 100644
--- a/app/views/articles/_sidebar_nav.html.erb
+++ b/app/views/articles/_sidebar_nav.html.erb
@@ -44,9 +44,9 @@
<%= inline_svg_tag("twemoji/tag.svg", aria: true, class: "crayons-icon crayons-icon--default", title: "Tags") %>
Tags
-
+
More...
-
+
<%= inline_svg_tag("twemoji/thumb-up.svg", aria: true, class: "crayons-icon crayons-icon--default", title: "Code of Conduct") %>
@@ -56,7 +56,7 @@
<%= inline_svg_tag("twemoji/bulb.svg", aria: true, class: "crayons-icon crayons-icon--default", title: "FAQ") %>
FAQ
-
+
<%= inline_svg_tag("twemoji/shopping.svg", aria: true, class: "crayons-icon crayons-icon--default", title: "Shop") %>
<%= community_name %> Shop
diff --git a/config/routes.rb b/config/routes.rb
index ffc48ce5a..229c9de9d 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -320,7 +320,11 @@ Rails.application.routes.draw do
post "articles/preview" => "articles#preview"
post "comments/preview" => "comments#preview"
get "/stories/warm_comments/:username/:slug" => "stories#warm_comments"
- get "/shop", to: redirect("https://shop.dev.to/")
+
+ # NOTE: can't remove the hardcoded URL here as SiteConfig is not available here, we should eventually
+ # setup dynamic redirects, see
+ get "/shop", to: redirect("https://shop.dev.to")
+
get "/mod" => "moderations#index", :as => :mod
get "/mod/:tag" => "moderations#index"
get "/page/crayons" => "pages#crayons"
diff --git a/spec/requests/internal/configs_spec.rb b/spec/requests/internal/configs_spec.rb
index 2d02b17de..6250eb117 100644
--- a/spec/requests/internal/configs_spec.rb
+++ b/spec/requests/internal/configs_spec.rb
@@ -247,11 +247,13 @@ RSpec.describe "/internal/config", type: :request do
describe "Shop" do
it "rejects update to shop_url without proper confirmation" do
expected_shop_url = "https://qshop.dev.to"
- expect { post "/internal/config", params: { site_config: { shop_url: expected_shop_url }, confirmation: "Incorrect confirmation" } }.to raise_error Pundit::NotAuthorizedError
+
+ expect do
+ params = { site_config: { shop_url: expected_shop_url }, confirmation: "Incorrect confirmation" }
+ post "/internal/config", params: params
+ end.to raise_error(Pundit::NotAuthorizedError)
+
expect(SiteConfig.shop_url).not_to eq(expected_shop_url)
- get "/privacy"
- expect(response.body).not_to include(expected_shop_url)
- expect(response.body).to include("#{ApplicationConfig['COMMUNITY_NAME']} Shop")
end
it "sets shop_url to nil" do
diff --git a/spec/routing/all_routes_spec.rb b/spec/routing/all_routes_spec.rb
index bf6334eef..8eed41cfb 100644
--- a/spec/routing/all_routes_spec.rb
+++ b/spec/routing/all_routes_spec.rb
@@ -32,9 +32,10 @@ RSpec.describe "all routes", type: :routing do
context "when redirected routes" do
include RSpec::Rails::RequestExampleGroup
- it "redirects /shop to shop.dev.to" do
- get "/shop"
- expect(response).to redirect_to("https://shop.dev.to/")
+ it "redirects /shop to the default shop_url" do
+ get shop_path
+
+ expect(response).to redirect_to(SiteConfig.shop_url)
end
end
end