Cleaned up the IssueController redirects to use the back_url like the other actions.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3315 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -947,6 +947,36 @@ class IssuesControllerTest < ActionController::TestCase
|
||||
assert_equal 4, issue.fixed_version_id
|
||||
assert_not_equal issue.project_id, issue.fixed_version.project_id
|
||||
end
|
||||
|
||||
def test_post_edit_should_redirect_back_using_the_back_url_parameter
|
||||
issue = Issue.find(2)
|
||||
@request.session[:user_id] = 2
|
||||
|
||||
post :edit,
|
||||
:id => issue.id,
|
||||
:issue => {
|
||||
:fixed_version_id => 4
|
||||
},
|
||||
:back_url => '/issues'
|
||||
|
||||
assert_response :redirect
|
||||
assert_redirected_to '/issues'
|
||||
end
|
||||
|
||||
def test_post_edit_should_not_redirect_back_using_the_back_url_parameter_off_the_host
|
||||
issue = Issue.find(2)
|
||||
@request.session[:user_id] = 2
|
||||
|
||||
post :edit,
|
||||
:id => issue.id,
|
||||
:issue => {
|
||||
:fixed_version_id => 4
|
||||
},
|
||||
:back_url => 'http://google.com'
|
||||
|
||||
assert_response :redirect
|
||||
assert_redirected_to :controller => 'issues', :action => 'show', :id => issue.id
|
||||
end
|
||||
|
||||
def test_get_bulk_edit
|
||||
@request.session[:user_id] = 2
|
||||
@@ -1053,6 +1083,22 @@ class IssuesControllerTest < ActionController::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
def test_post_bulk_edit_should_redirect_back_using_the_back_url_parameter
|
||||
@request.session[:user_id] = 2
|
||||
post :bulk_edit, :ids => [1,2], :back_url => '/issues'
|
||||
|
||||
assert_response :redirect
|
||||
assert_redirected_to '/issues'
|
||||
end
|
||||
|
||||
def test_post_bulk_edit_should_not_redirect_back_using_the_back_url_parameter_off_the_host
|
||||
@request.session[:user_id] = 2
|
||||
post :bulk_edit, :ids => [1,2], :back_url => 'http://google.com'
|
||||
|
||||
assert_response :redirect
|
||||
assert_redirected_to :controller => 'issues', :action => 'index', :project_id => Project.find(1).identifier
|
||||
end
|
||||
|
||||
def test_move_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/issues/1/move'},
|
||||
|
||||
Reference in New Issue
Block a user