@@ -68,7 +68,9 class AuthSourcesControllerTest < ActionController::TestCase | |||||
68 |
|
68 | |||
69 | def test_create_with_failure |
|
69 | def test_create_with_failure | |
70 | assert_no_difference 'AuthSourceLdap.count' do |
|
70 | assert_no_difference 'AuthSourceLdap.count' do | |
71 | post :create, :type => 'AuthSourceLdap', :auth_source => {:name => 'Test', :host => '', :port => '389', :attr_login => 'cn'} |
|
71 | post :create, :type => 'AuthSourceLdap', | |
|
72 | :auth_source => {:name => 'Test', :host => '', | |||
|
73 | :port => '389', :attr_login => 'cn'} | |||
72 | assert_response :success |
|
74 | assert_response :success | |
73 | assert_template 'new' |
|
75 | assert_template 'new' | |
74 | end |
|
76 | end | |
@@ -101,16 +103,19 class AuthSourcesControllerTest < ActionController::TestCase | |||||
101 | end |
|
103 | end | |
102 |
|
104 | |||
103 | def test_update |
|
105 | def test_update | |
104 | put :update, :id => 1, :auth_source => {:name => 'Renamed', :host => '192.168.0.10', :port => '389', :attr_login => 'uid'} |
|
106 | put :update, :id => 1, | |
|
107 | :auth_source => {:name => 'Renamed', :host => '192.168.0.10', | |||
|
108 | :port => '389', :attr_login => 'uid'} | |||
105 | assert_redirected_to '/auth_sources' |
|
109 | assert_redirected_to '/auth_sources' | |
106 |
|
||||
107 | source = AuthSourceLdap.find(1) |
|
110 | source = AuthSourceLdap.find(1) | |
108 | assert_equal 'Renamed', source.name |
|
111 | assert_equal 'Renamed', source.name | |
109 | assert_equal '192.168.0.10', source.host |
|
112 | assert_equal '192.168.0.10', source.host | |
110 | end |
|
113 | end | |
111 |
|
114 | |||
112 | def test_update_with_failure |
|
115 | def test_update_with_failure | |
113 | put :update, :id => 1, :auth_source => {:name => 'Renamed', :host => '', :port => '389', :attr_login => 'uid'} |
|
116 | put :update, :id => 1, | |
|
117 | :auth_source => {:name => 'Renamed', :host => '', | |||
|
118 | :port => '389', :attr_login => 'uid'} | |||
114 | assert_response :success |
|
119 | assert_response :success | |
115 | assert_template 'edit' |
|
120 | assert_template 'edit' | |
116 | assert_error_tag :content => /host can't be blank/i |
|
121 | assert_error_tag :content => /host can't be blank/i |
General Comments 0
You need to be logged in to leave comments.
Login now