# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class CustomFieldsControllerTest < ActionController::TestCase
fixtures :custom_fields, :trackers, :users
-
+
def setup
@controller = CustomFieldsController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
@request.session[:user_id] = 1
end
-
+
def test_get_new_issue_custom_field
get :new, :type => 'IssueCustomField'
assert_response :success
:content => 'Version'
}
end
-
+
def test_get_new_with_invalid_custom_field_class_should_redirect_to_list
get :new, :type => 'UnknownCustomField'
assert_redirected_to '/custom_fields'
end
-
+
def test_post_new_list_custom_field
assert_difference 'CustomField.count' do
post :new, :type => "IssueCustomField",
:is_required =>"0",
:field_format => "list",
:tracker_ids => ["1", ""]}
- end
+ end
assert_redirected_to '/custom_fields?tab=IssueCustomField'
field = IssueCustomField.find_by_name('test_post_new_list')
assert_not_nil field