Commit 48b1de6dfdbd44708937e000e9768a2c130d3f27

Authored by Antonio Terceiro
1 parent 7a14f984

Remove warnings in functional tests

app/controllers/my_profile/tasks_controller.rb
... ... @@ -33,12 +33,14 @@ class TasksController < MyProfileController
33 33 end
34 34 end
35 35  
  36 + url = { :action => 'index' }
36 37 if failed.blank?
37 38 session[:notice] = _("All decisions were applied successfully.")
38 39 else
39 40 session[:notice] = _("Some decisions couldn't be applied.")
  41 + url[:failed] = failed
40 42 end
41   - redirect_to params.merge!(:action => 'index', :failed => failed)
  43 + redirect_to url
42 44 end
43 45  
44 46 def new
... ...
test/functional/catalog_controller_test.rb
... ... @@ -26,7 +26,7 @@ class CatalogControllerTest < ActionController::TestCase
26 26 should 'not display for non-enterprises' do
27 27 u = create_user('testinguser').person
28 28 get :index, :profile => 'testinguser'
29   - assert_redirected_to :controller => "profile", :profile => 'testinguser'
  29 + assert_redirected_to :controller => "profile", :profile => 'testinguser', :action => 'index'
30 30 end
31 31  
32 32 should 'display for enterprises' do
... ...
test/functional/cms_controller_test.rb
... ... @@ -202,7 +202,7 @@ class CmsControllerTest < ActionController::TestCase
202 202  
203 203 assert_difference Article, :count, -1 do
204 204 post :destroy, :profile => profile.identifier, :id => a.id
205   - assert_redirected_to :action => 'index'
  205 + assert_redirected_to :controller => 'cms', :profile => profile.identifier, :action => 'index'
206 206 end
207 207 end
208 208  
... ... @@ -959,7 +959,7 @@ class CmsControllerTest < ActionController::TestCase
959 959  
960 960 post :upload_files, :profile => profile.identifier, :parent_id => folder.id, :back_to => @request.referer, :uploaded_files => [fixture_file_upload('files/rails.png', 'image/png')]
961 961 assert_template nil
962   - assert_redirected_to folder.view_url
  962 + assert_redirected_to 'http://localhost/testinguser/test-folder'
963 963 end
964 964  
965 965 should 'record when coming from public view on edit files with view true' do
... ... @@ -1416,7 +1416,7 @@ class CmsControllerTest < ActionController::TestCase
1416 1416 should 'update file and be redirect to cms' do
1417 1417 file = UploadedFile.create!(:profile => @profile, :uploaded_data => fixture_file_upload('files/test.txt', 'text/plain'))
1418 1418 post :edit, :profile => @profile.identifier, :id => file.id, :article => { }
1419   - assert_redirected_to :action => 'index'
  1419 + assert_redirected_to :controller => 'cms', :profile => profile.identifier, :action => 'index'
1420 1420 end
1421 1421  
1422 1422 should 'update file and be redirect to cms folder' do
... ...
test/functional/mailconf_controller_test.rb
... ... @@ -99,7 +99,7 @@ class MailconfControllerTest < ActionController::TestCase
99 99 should 'go back on save' do
100 100 login_as('ze')
101 101 post :enable, :profile => 'ze'
102   - assert_redirected_to :controller => 'profile_editor'
  102 + assert_redirected_to :controller => 'profile_editor', :action => 'edit'
103 103 end
104 104  
105 105 should 'go to profile editor after enable email' do
... ...
test/functional/manage_products_controller_test.rb
... ... @@ -146,10 +146,10 @@ class ManageProductsControllerTest < ActionController::TestCase
146 146 assert_no_difference Product, :count do
147 147 post 'destroy', :profile => @enterprise.identifier, :id => product.id
148 148 assert_response :redirect
149   - assert_redirected_to :action => 'show'
  149 + assert_redirected_to :controller => "manage_products", :profile => @enterprise.identifier, :action => 'show', :id => product.id
150 150 assert assigns(:product)
151   - assert Product.find_by_name('test product')
152   - end
  151 + assert Product.find_by_name('test product')
  152 + end
153 153 end
154 154  
155 155 should 'show categories selection' do
... ...
test/functional/profile_controller_test.rb
... ... @@ -1205,7 +1205,7 @@ class ProfileControllerTest < ActionController::TestCase
1205 1205 @request.stubs(:host).returns(community.environment.default_hostname)
1206 1206 get :index, :profile => community.identifier
1207 1207 assert_response :redirect
1208   - assert_redirected_to :host => 'community.example.net'
  1208 + assert_redirected_to :host => 'community.example.net', :controller => 'profile', :action => 'index'
1209 1209 end
1210 1210  
1211 1211 should 'register abuse report' do
... ...
test/functional/tasks_controller_test.rb
... ... @@ -18,6 +18,10 @@ class TasksControllerTest < ActionController::TestCase
18 18 end
19 19 attr_accessor :profile
20 20  
  21 + def assert_redirected_to(options)
  22 + super({ :controller => 'tasks', :profile => profile.identifier }.merge(options))
  23 + end
  24 +
21 25 def test_local_files_reference
22 26 assert_local_files_reference
23 27 end
... ...
test/functional/themes_controller_test.rb
... ... @@ -234,7 +234,7 @@ class ThemesControllerTest < ActionController::TestCase
234 234 post :start_test, :profile => 'testinguser', :id => 'theme-under-test'
235 235  
236 236 assert_equal 'theme-under-test', session[:theme]
237   - assert_redirected_to :controller => 'content_viewer', :profile => 'testinguser'
  237 + assert_redirected_to :controller => 'content_viewer', :profile => 'testinguser', :action => 'view_page'
238 238 end
239 239  
240 240 should 'stop testing theme' do
... ...