Mercurial > hg > soundsoftware-site
comparison test/functional/custom_fields_controller_test.rb @ 1298:4f746d8966dd redmine_2.3_integration
Merge from redmine-2.3 branch to create new branch redmine-2.3-integration
author | Chris Cannam |
---|---|
date | Fri, 14 Jun 2013 09:28:30 +0100 |
parents | 622f24f53b42 |
children |
comparison
equal
deleted
inserted
replaced
1297:0a574315af3e | 1298:4f746d8966dd |
---|---|
1 # Redmine - project management software | 1 # Redmine - project management software |
2 # Copyright (C) 2006-2012 Jean-Philippe Lang | 2 # Copyright (C) 2006-2013 Jean-Philippe Lang |
3 # | 3 # |
4 # This program is free software; you can redistribute it and/or | 4 # This program is free software; you can redistribute it and/or |
5 # modify it under the terms of the GNU General Public License | 5 # modify it under the terms of the GNU General Public License |
6 # as published by the Free Software Foundation; either version 2 | 6 # as published by the Free Software Foundation; either version 2 |
7 # of the License, or (at your option) any later version. | 7 # of the License, or (at your option) any later version. |
52 assert_select 'option[value=user]', :text => 'User' | 52 assert_select 'option[value=user]', :text => 'User' |
53 assert_select 'option[value=version]', :text => 'Version' | 53 assert_select 'option[value=version]', :text => 'Version' |
54 end | 54 end |
55 assert_select 'input[type=hidden][name=type][value=IssueCustomField]' | 55 assert_select 'input[type=hidden][name=type][value=IssueCustomField]' |
56 end | 56 end |
57 end | |
58 | |
59 def test_default_value_should_be_an_input_for_string_custom_field | |
60 get :new, :type => 'IssueCustomField', :custom_field => {:field_format => 'string'} | |
61 assert_response :success | |
62 assert_select 'input[name=?]', 'custom_field[default_value]' | |
63 end | |
64 | |
65 def test_default_value_should_be_a_textarea_for_text_custom_field | |
66 get :new, :type => 'IssueCustomField', :custom_field => {:field_format => 'text'} | |
67 assert_response :success | |
68 assert_select 'textarea[name=?]', 'custom_field[default_value]' | |
69 end | |
70 | |
71 def test_default_value_should_be_a_checkbox_for_bool_custom_field | |
72 get :new, :type => 'IssueCustomField', :custom_field => {:field_format => 'bool'} | |
73 assert_response :success | |
74 assert_select 'input[name=?][type=checkbox]', 'custom_field[default_value]' | |
75 end | |
76 | |
77 def test_default_value_should_not_be_present_for_user_custom_field | |
78 get :new, :type => 'IssueCustomField', :custom_field => {:field_format => 'user'} | |
79 assert_response :success | |
80 assert_select '[name=?]', 'custom_field[default_value]', 0 | |
57 end | 81 end |
58 | 82 |
59 def test_new_js | 83 def test_new_js |
60 get :new, :type => 'IssueCustomField', :custom_field => {:field_format => 'list'}, :format => 'js' | 84 get :new, :type => 'IssueCustomField', :custom_field => {:field_format => 'list'}, :format => 'js' |
61 assert_response :success | 85 assert_response :success |