code format clean up AuthSourcesControllerTest

git-svn-id: http://svn.redmine.org/redmine/trunk@12795 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2014-02-04 23:49:55 +00:00
parent e91bce3d05
commit f1572de51e
1 changed files with 9 additions and 4 deletions

View File

@ -68,7 +68,9 @@ class AuthSourcesControllerTest < ActionController::TestCase
def test_create_with_failure def test_create_with_failure
assert_no_difference 'AuthSourceLdap.count' do assert_no_difference 'AuthSourceLdap.count' do
post :create, :type => 'AuthSourceLdap', :auth_source => {:name => 'Test', :host => '', :port => '389', :attr_login => 'cn'} post :create, :type => 'AuthSourceLdap',
:auth_source => {:name => 'Test', :host => '',
:port => '389', :attr_login => 'cn'}
assert_response :success assert_response :success
assert_template 'new' assert_template 'new'
end end
@ -101,16 +103,19 @@ class AuthSourcesControllerTest < ActionController::TestCase
end end
def test_update def test_update
put :update, :id => 1, :auth_source => {:name => 'Renamed', :host => '192.168.0.10', :port => '389', :attr_login => 'uid'} put :update, :id => 1,
:auth_source => {:name => 'Renamed', :host => '192.168.0.10',
:port => '389', :attr_login => 'uid'}
assert_redirected_to '/auth_sources' assert_redirected_to '/auth_sources'
source = AuthSourceLdap.find(1) source = AuthSourceLdap.find(1)
assert_equal 'Renamed', source.name assert_equal 'Renamed', source.name
assert_equal '192.168.0.10', source.host assert_equal '192.168.0.10', source.host
end end
def test_update_with_failure def test_update_with_failure
put :update, :id => 1, :auth_source => {:name => 'Renamed', :host => '', :port => '389', :attr_login => 'uid'} put :update, :id => 1,
:auth_source => {:name => 'Renamed', :host => '',
:port => '389', :attr_login => 'uid'}
assert_response :success assert_response :success
assert_template 'edit' assert_template 'edit'
assert_error_tag :content => /host can&#x27;t be blank/i assert_error_tag :content => /host can&#x27;t be blank/i