@@ -68,7 +68,9 class AuthSourcesControllerTest < ActionController::TestCase | |||
|
68 | 68 | |
|
69 | 69 | def test_create_with_failure |
|
70 | 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 | 74 | assert_response :success |
|
73 | 75 | assert_template 'new' |
|
74 | 76 | end |
@@ -101,16 +103,19 class AuthSourcesControllerTest < ActionController::TestCase | |||
|
101 | 103 | end |
|
102 | 104 | |
|
103 | 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 | 109 | assert_redirected_to '/auth_sources' |
|
106 | ||
|
107 | 110 | source = AuthSourceLdap.find(1) |
|
108 | 111 | assert_equal 'Renamed', source.name |
|
109 | 112 | assert_equal '192.168.0.10', source.host |
|
110 | 113 | end |
|
111 | 114 | |
|
112 | 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 | 119 | assert_response :success |
|
115 | 120 | assert_template 'edit' |
|
116 | 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