diff --git a/app/assets/javascripts/darkswarm/cookies_policy/cookies_policy_modal_service.js.coffee b/app/assets/javascripts/darkswarm/cookies_policy/cookies_policy_modal_service.js.coffee index 5377018089..0f91645cfd 100644 --- a/app/assets/javascripts/darkswarm/cookies_policy/cookies_policy_modal_service.js.coffee +++ b/app/assets/javascripts/darkswarm/cookies_policy/cookies_policy_modal_service.js.coffee @@ -8,7 +8,7 @@ Darkswarm.factory "CookiesPolicyModalService", (Navigation, $modal, $location, C if $location.path() is @defaultPath || location.pathname is @defaultPath @open '' - open: (path = false, template = 'darkswarm/cookies_policy/cookies_policy.html') => + open: (path = false, template = 'angular-templates/cookies_policy.html') => @modalInstance = $modal.open templateUrl: template windowClass: "cookies-policy-modal medium" diff --git a/app/controllers/angular_templates_controller.rb b/app/controllers/angular_templates_controller.rb new file mode 100644 index 0000000000..44d870cc58 --- /dev/null +++ b/app/controllers/angular_templates_controller.rb @@ -0,0 +1,5 @@ +class AngularTemplatesController < ApplicationController + def show + render params[:id].to_s, layout: nil + end +end diff --git a/app/assets/javascripts/darkswarm/cookies_policy/cookies_policy.html.haml b/app/views/angular_templates/cookies_policy.html.haml similarity index 100% rename from app/assets/javascripts/darkswarm/cookies_policy/cookies_policy.html.haml rename to app/views/angular_templates/cookies_policy.html.haml diff --git a/config/routes.rb b/config/routes.rb index ed4f517a4a..a1ce680804 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -80,6 +80,8 @@ Openfoodnetwork::Application.routes.draw do get '/:id/shop', to: 'enterprises#shop', as: 'enterprise_shop' get "/enterprises/:permalink", to: redirect("/") # Legacy enterprise URL + get "/angular-templates/:id", to: "angular_templates#show", constraints: { name: %r{[\/\w\.]+} } + namespace :api do resources :enterprises do post :update_image, on: :member diff --git a/spec/features/consumer/cookies_spec.rb b/spec/features/consumer/cookies_spec.rb index 84f4f0d3b7..b9755ddc5a 100644 --- a/spec/features/consumer/cookies_spec.rb +++ b/spec/features/consumer/cookies_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' feature "Cookies", js: true do - describe "banner", js: true do + describe "banner" do describe "in the homepage" do before do Spree::Config[:cookies_consent_banner_toggle] = true @@ -57,8 +57,7 @@ feature "Cookies", js: true do scenario "shows Matomo cookies details" do Spree::Config[:cookies_policy_matomo_section] = true visit '/#/policies/cookies' - # before { skip("test not working, settings are not picked up") } - # expect(page).to have_content matomo_description_text + expect(page).to have_content matomo_description_text end end