summaryrefslogtreecommitdiffstats
path: root/test/functional/account_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-09-20 09:56:06 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-09-20 09:56:06 +0000
commit52a6b0a21e5e28da4ed590383ae778c306cfaf1b (patch)
treea1981b858f48b25546bedc22e9994da0cad914a4 /test/functional/account_controller_test.rb
parent41cbd239c44eb8f702d04a8b0ba25dfc381483ad (diff)
downloadredmine-52a6b0a21e5e28da4ed590383ae778c306cfaf1b.tar.gz
redmine-52a6b0a21e5e28da4ed590383ae778c306cfaf1b.zip
Fixed: Custom values with a nil value cause error on (project|account)/show (#3705).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2894 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/account_controller_test.rb')
-rw-r--r--test/functional/account_controller_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/account_controller_test.rb b/test/functional/account_controller_test.rb
index 8184fa312..e38ccb543 100644
--- a/test/functional/account_controller_test.rb
+++ b/test/functional/account_controller_test.rb
@@ -37,7 +37,19 @@ class AccountControllerTest < ActionController::TestCase
assert_template 'show'
assert_not_nil assigns(:user)
end
+
+ def test_show_should_not_fail_when_custom_values_are_nil
+ user = User.find(2)
+
+ # Create a custom field to illustrate the issue
+ custom_field = CustomField.create!(:name => 'Testing', :field_format => 'text')
+ custom_value = user.custom_values.build(:custom_field => custom_field).save!
+
+ get :show, :id => 2
+ assert_response :success
+ end
+
def test_show_inactive
get :show, :id => 5
assert_response 404