From 081ed9096867872e8971642a95284b082db6d9cd Mon Sep 17 00:00:00 2001 From: Simon Lehericey Date: Thu, 29 Jun 2017 14:11:48 +0200 Subject: [PATCH] New Routes: add new_user/user_controller --- app/controllers/new_user/user_controller.rb | 5 +++++ spec/controllers/new_user/user_controller_spec.rb | 14 ++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 app/controllers/new_user/user_controller.rb create mode 100644 spec/controllers/new_user/user_controller_spec.rb diff --git a/app/controllers/new_user/user_controller.rb b/app/controllers/new_user/user_controller.rb new file mode 100644 index 000000000..5cd85ae0f --- /dev/null +++ b/app/controllers/new_user/user_controller.rb @@ -0,0 +1,5 @@ +module NewUser + class UserController < ApplicationController + before_action :authenticate_user! + end +end diff --git a/spec/controllers/new_user/user_controller_spec.rb b/spec/controllers/new_user/user_controller_spec.rb new file mode 100644 index 000000000..125466fb6 --- /dev/null +++ b/spec/controllers/new_user/user_controller_spec.rb @@ -0,0 +1,14 @@ +require 'spec_helper' + +describe NewUser::UserController, type: :controller do + describe 'before actions: authenticate_gestionnaire!' do + it 'is present' do + before_actions = NewUser::UserController + ._process_action_callbacks + .find_all{|process_action_callbacks| process_action_callbacks.kind == :before} + .map(&:filter) + + expect(before_actions).to include(:authenticate_user!) + end + end +end