Merge pull request #940 from sgmap/remove_public_demo_page

[Fix #939] Remove demo page in staging
This commit is contained in:
Mathieu Magnin 2017-11-16 12:27:39 +01:00 committed by GitHub
commit 1f36d20220
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 0 additions and 60 deletions

View file

@ -1,13 +0,0 @@
class DemoController < ApplicationController
include SmartListing::Helper::ControllerExtensions
helper SmartListing::Helper
def index
return redirect_to root_path if Rails.env.production?
smart_listing_create :procedures,
Procedure.publiees.order("id DESC"),
partial: "demo/list",
array: true
end
end

View file

@ -1,27 +0,0 @@
- unless smart_listing.empty?
%table.table
%tr
%th{ colspan: 4 }
%h4 Lien vers les procédures TPS
%tr
%th= smart_listing.sortable 'ID', 'id'
%th= smart_listing.sortable 'Titre', 'libelle'
%th Description
%th= smart_listing.sortable 'Organisme', 'organisation'
- smart_listing.collection.each do |procedure|
- procedure = procedure.decorate
%tr
%td
= procedure.id
%td.col-xs-4
= link_to procedure.libelle, procedure.lien
%td
= procedure.description
%td.col-xs-3
= procedure.organisation
= smart_listing.paginate
= smart_listing.pagination_per_page_links
- else
%p Aucune procédure trouvée

View file

@ -1 +0,0 @@
= smart_listing_render :procedures

View file

@ -1 +0,0 @@
<%= smart_listing_update :procedures %>

View file

@ -39,7 +39,6 @@ Rails.application.routes.draw do
root 'root#index'
get 'cgu' => 'cgu#index'
get 'demo' => 'demo#index'
get 'users' => 'users#index'
get 'admin' => 'admin#index'
get 'backoffice' => 'backoffice#index'

View file

@ -1,17 +0,0 @@
require 'spec_helper'
describe DemoController, type: :controller do
describe 'GET #index' do
subject { get :index }
it { expect(subject.status).to eq 200 }
context 'when rails environnement is production' do
before do
allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new("production"))
end
it { expect(subject.status).to eq 302 }
end
end
end