Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Commit

Permalink
Merge pull request #224 from spree-contrib/revert-213-static-page-pro…
Browse files Browse the repository at this point in the history
…motions

Revert "Fire Spree::PromotionHandler::Page on static page show"
  • Loading branch information
damianlegawiec committed Dec 15, 2016
2 parents 82bcf3c + e115113 commit 41ea4c0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 16 deletions.
5 changes: 0 additions & 5 deletions app/controllers/spree/static_content_controller.rb
@@ -1,7 +1,6 @@
module Spree
class StaticContentController < StoreController
rescue_from ActiveRecord::RecordNotFound, with: :render_404
after_action :fire_visited_path, only: :show

helper 'spree/products'
layout :determine_layout
Expand All @@ -20,9 +19,5 @@ def determine_layout
def accurate_title
@page ? (@page.meta_title.present? ? @page.meta_title : @page.title) : nil
end

def fire_visited_path
Spree::PromotionHandler::Page.new(current_order, params[:path]).activate
end
end
end
9 changes: 0 additions & 9 deletions spec/controllers/static_content_controller_spec.rb
Expand Up @@ -32,14 +32,5 @@
spree_get :show
expect(response.response_code).to be(404)
end

it 'activates Spree::PromotionHandler::Page handler' do
page = create(:page, slug: 'promo', stores: [store])
current_order = double(:order)
allow(controller).to receive(:current_order).and_return(current_order)
allow(controller.request).to receive(:path).and_return(page.slug)
expect(Spree::PromotionHandler::Page).to receive(:new).with(current_order, page.slug).and_return(double(:handler, activate: true))
spree_get :show, path: page.slug
end
end
end
2 changes: 0 additions & 2 deletions spec/features/static_content_spec.rb
Expand Up @@ -2,8 +2,6 @@
let!(:store) { create(:store, default: true) }

context 'render page' do
before { allow(Spree::PromotionHandler::Page).to receive(:new).and_return(double(:handler, activate: true)) }

scenario 'is a query string' do
create(:page, slug: '/page', title: 'Query Test', stores: [store])
visit '/page?test'
Expand Down

0 comments on commit 41ea4c0

Please sign in to comment.