summaryrefslogtreecommitdiffstats
path: root/test/functional/users_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-11-07 14:15:01 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-11-07 14:15:01 +0000
commit475530e59f65f3e8d24623383512e092b2d02521 (patch)
tree76e9b403b548ee62b3f5b05fcf9a0c7554add13d /test/functional/users_controller_test.rb
parent3b01ea9fa42cec01a17664a64de6f8157d363bec (diff)
downloadredmine-475530e59f65f3e8d24623383512e092b2d02521.tar.gz
redmine-475530e59f65f3e8d24623383512e092b2d02521.zip
Adds a "visible" option on User and Project custom fields (#1738).
If set to false, the custom field won't be display on user profile/project overview. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4382 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/users_controller_test.rb')
-rw-r--r--test/functional/users_controller_test.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb
index 5e288d445..100ec8ded 100644
--- a/test/functional/users_controller_test.rb
+++ b/test/functional/users_controller_test.rb
@@ -24,7 +24,7 @@ class UsersController; def rescue_action(e) raise e end; end
class UsersControllerTest < ActionController::TestCase
include Redmine::I18n
- fixtures :users, :projects, :members, :member_roles, :roles, :auth_sources
+ fixtures :users, :projects, :members, :member_roles, :roles, :auth_sources, :custom_fields, :custom_values
def setup
@controller = UsersController.new
@@ -65,6 +65,19 @@ class UsersControllerTest < ActionController::TestCase
assert_response :success
assert_template 'show'
assert_not_nil assigns(:user)
+
+ assert_tag 'li', :content => /Phone number/
+ end
+
+ def test_show_should_not_display_hidden_custom_fields
+ @request.session[:user_id] = nil
+ UserCustomField.find_by_name('Phone number').update_attribute :visible, false
+ get :show, :id => 2
+ assert_response :success
+ assert_template 'show'
+ assert_not_nil assigns(:user)
+
+ assert_no_tag 'li', :content => /Phone number/
end
def test_show_should_not_fail_when_custom_values_are_nil