-
Notifications
You must be signed in to change notification settings - Fork 267
Expand file tree
/
Copy pathutils_spec.rb
More file actions
26 lines (20 loc) · 835 Bytes
/
utils_spec.rb
File metadata and controls
26 lines (20 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# encoding: UTF-8
require 'spec_helper'
module CASServer
end
require 'casserver/utils'
describe CASServer::Utils, '#log_controller_action(controller, params)' do
let(:params) { {} }
let(:params_with_password) { { 'password' => 'test' } }
let(:params_with_password_filtered) { { 'password' => '******' } }
it 'should log the controller action' do
$LOG.should_receive(:<<).with "\n"
$LOG.should_receive(:debug).with 'Processing application::instance_exec {}'
subject.log_controller_action('application', params)
end
it 'should filter password parameters in the log' do
$LOG.should_receive(:<<).with "\n"
$LOG.should_receive(:debug).with "Processing application::instance_exec #{params_with_password_filtered.inspect}"
subject.log_controller_action('application', params_with_password)
end
end