From fc066a42ec5a3271b0d476ff2c5ab771f1ab726d Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 3 May 2016 10:24:11 -0300 Subject: fix failing unit and functional tests --- app/controllers/controller_extension/fetch_user.rb | 2 +- app/models/api_monitor_user.rb | 11 +++++++++++ app/models/api_user.rb | 13 +------------ 3 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 app/models/api_monitor_user.rb (limited to 'app') diff --git a/app/controllers/controller_extension/fetch_user.rb b/app/controllers/controller_extension/fetch_user.rb index 97f92fa..632291d 100644 --- a/app/controllers/controller_extension/fetch_user.rb +++ b/app/controllers/controller_extension/fetch_user.rb @@ -22,7 +22,7 @@ module ControllerExtension::FetchUser @user = User.find(params[:user_id] || params[:id]) if current_user.is_admin? || current_user.is_monitor? if @user.nil? - not_found(t(:no_such_thing, :thing => 'user'), users_url) + not_found(t(:no_such_user), users_url) elsif current_user.is_monitor? access_denied unless @user.is_test? end diff --git a/app/models/api_monitor_user.rb b/app/models/api_monitor_user.rb new file mode 100644 index 0000000..d0fe411 --- /dev/null +++ b/app/models/api_monitor_user.rb @@ -0,0 +1,11 @@ +# +# A user that has limited admin access, to be used +# for running monitor tests against a live production +# installation. +# +class ApiMonitorUser < ApiUser + def is_monitor? + true + end +end + diff --git a/app/models/api_user.rb b/app/models/api_user.rb index 2efe1cb..c70cccb 100644 --- a/app/models/api_user.rb +++ b/app/models/api_user.rb @@ -2,17 +2,6 @@ class ApiUser < AnonymousUser end -# -# A user that has limited admin access, to be used -# for running monitor tests against a live production -# installation. -# -class ApiMonitorUser < ApiUser - def is_monitor? - true - end -end - # # Not yet supported: # @@ -20,4 +9,4 @@ end # def is_admin? # true # end -#end \ No newline at end of file +#end -- cgit v1.2.3