From 34f120881403ada2ccf441f774339035fc6c6f45 Mon Sep 17 00:00:00 2001 From: Saurabh Bhatia Date: Wed, 21 Aug 2024 21:48:53 +1000 Subject: [PATCH] Star Gazers landing --- app/controllers/landing_controller.rb | 10 ++++++++++ app/controllers/pages_controller.rb | 6 ------ app/helpers/landing_helper.rb | 2 ++ app/views/landing/index.html.erb | 6 ++++++ app/views/landing/star_gazers.html.erb | 1 + app/views/pages/star_gazers.html.erb | 21 --------------------- config/routes.rb | 6 ++++++ spec/helpers/landing_helper_spec.rb | 15 +++++++++++++++ spec/requests/landing_spec.rb | 11 +++++++++++ spec/views/landing/index.html.erb_spec.rb | 5 +++++ 10 files changed, 56 insertions(+), 27 deletions(-) create mode 100644 app/controllers/landing_controller.rb create mode 100644 app/helpers/landing_helper.rb create mode 100644 app/views/landing/index.html.erb create mode 100644 app/views/landing/star_gazers.html.erb delete mode 100644 app/views/pages/star_gazers.html.erb create mode 100644 spec/helpers/landing_helper_spec.rb create mode 100644 spec/requests/landing_spec.rb create mode 100644 spec/views/landing/index.html.erb_spec.rb diff --git a/app/controllers/landing_controller.rb b/app/controllers/landing_controller.rb new file mode 100644 index 00000000..b5f7caf2 --- /dev/null +++ b/app/controllers/landing_controller.rb @@ -0,0 +1,10 @@ +class LandingController < ApplicationController + def index + end + + def star_gazers + set_meta_tags title: "Star Gazers : Sirius", + description: "Star Gazers : Sirius", + keywords: "Comics, Indie comics" + end +end diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index c0f5aa5d..3aa1df4f 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -12,10 +12,4 @@ def for_creators description: "For Creators page", keywords: "Comics, Indie comics" end - - def star_gazers - set_meta_tags title: "Star Gazers : Sirius", - description: "Star Gazers : Sirius", - keywords: "Comics, Indie comics" - end end diff --git a/app/helpers/landing_helper.rb b/app/helpers/landing_helper.rb new file mode 100644 index 00000000..6aa3ee92 --- /dev/null +++ b/app/helpers/landing_helper.rb @@ -0,0 +1,2 @@ +module LandingHelper +end diff --git a/app/views/landing/index.html.erb b/app/views/landing/index.html.erb new file mode 100644 index 00000000..91db738d --- /dev/null +++ b/app/views/landing/index.html.erb @@ -0,0 +1,6 @@ + + + + + Loading... + \ No newline at end of file diff --git a/app/views/landing/star_gazers.html.erb b/app/views/landing/star_gazers.html.erb new file mode 100644 index 00000000..e080e40d --- /dev/null +++ b/app/views/landing/star_gazers.html.erb @@ -0,0 +1 @@ +<%= render(PageTitleComponent.new(title: "Star Gazers : Sirius")) %> diff --git a/app/views/pages/star_gazers.html.erb b/app/views/pages/star_gazers.html.erb deleted file mode 100644 index db4bd1ba..00000000 --- a/app/views/pages/star_gazers.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -<%= render(PageTitleComponent.new(title: "Star Gazers : Sirius")) %> - -<% cache @product, expires_in: 60.seconds do %> -
-
- <%= render(Products::IssueCoverComponent.new(product: @product, user: current_user)) %> -
-
- <%= render(Products::IssueCoverMobileComponent.new(product: @product, user: current_user)) %> - <%= render(Products::DetailsComponent.new(product: @product)) %> -
-
- <%= render(Products::CreditsComponent.new(product: @product)) %> -
-
-<% end %> -<% cache @other_products, expires_in: 60.seconds do %> - <% if @other_products.present? %> - <%= render(Products::MoreProductsComponent.new(products: @other_products)) %> - <% end %> -<% end %> diff --git a/config/routes.rb b/config/routes.rb index 43a7b90c..0f5ab682 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,6 +2,7 @@ require "sidekiq/web" Rails.application.routes.draw do + get 'landing/index' if Rails.env.development? mount GraphiQL::Rails::Engine, at: "/graphiql", graphql_path: "/graphql" end @@ -46,6 +47,11 @@ resources :stores, param: :slug, only: [:show] resources :products, param: :slug, only: [:show] resources :stores, param: :slug, only: [:index, :show] + resources :landing, only: [:index] do + collection do + get :star_gazers + end + end resources :cart, only: [:show] do collection do post "add", to: "cart#add", as: :add diff --git a/spec/helpers/landing_helper_spec.rb b/spec/helpers/landing_helper_spec.rb new file mode 100644 index 00000000..98cd7013 --- /dev/null +++ b/spec/helpers/landing_helper_spec.rb @@ -0,0 +1,15 @@ +require 'rails_helper' + +# Specs in this file have access to a helper object that includes +# the LandingHelper. For example: +# +# describe LandingHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# expect(helper.concat_strings("this","that")).to eq("this that") +# end +# end +# end +RSpec.describe LandingHelper, type: :helper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/requests/landing_spec.rb b/spec/requests/landing_spec.rb new file mode 100644 index 00000000..480ac940 --- /dev/null +++ b/spec/requests/landing_spec.rb @@ -0,0 +1,11 @@ +require 'rails_helper' + +RSpec.describe "Landings", type: :request do + describe "GET /index" do + it "returns http success" do + get "/landing/index" + expect(response).to have_http_status(:success) + end + end + +end diff --git a/spec/views/landing/index.html.erb_spec.rb b/spec/views/landing/index.html.erb_spec.rb new file mode 100644 index 00000000..4f79b6ad --- /dev/null +++ b/spec/views/landing/index.html.erb_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe "landing/index.html.erb", type: :view do + pending "add some examples to (or delete) #{__FILE__}" +end