Merge remote-tracking branch 'upstream/pull/2060'

This commit is contained in:
Tom Hughes 2018-11-14 13:13:56 +00:00
commit 75189bd17d
7 changed files with 9 additions and 43 deletions

View file

@ -726,7 +726,7 @@ class DiaryEntriesControllerTest < ActionController::TestCase
:params => { :display_name => user.display_name, :id => diary_entry.id },
:session => { :user => user }
assert_response :redirect
assert_redirected_to :action => :show, :display_name => user.display_name, :id => diary_entry.id
assert_redirected_to :controller => :errors, :action => :forbidden
assert_equal true, DiaryEntry.find(diary_entry.id).visible
# Finally try as an administrator
@ -754,7 +754,7 @@ class DiaryEntriesControllerTest < ActionController::TestCase
:params => { :display_name => user.display_name, :id => diary_entry.id, :comment => diary_comment.id },
:session => { :user => user }
assert_response :redirect
assert_redirected_to :action => :show, :display_name => user.display_name, :id => diary_entry.id
assert_redirected_to :controller => :errors, :action => :forbidden
assert_equal true, DiaryComment.find(diary_comment.id).visible
# Finally try as an administrator

View file

@ -9,7 +9,7 @@ class IssueCommentsControllerTest < ActionController::TestCase
post :create, :params => { :issue_id => issue.id }
assert_response :redirect
assert_redirected_to root_path
assert_redirected_to :controller => :errors, :action => :forbidden
assert_equal 0, issue.comments.length
end

View file

@ -11,7 +11,7 @@ class IssuesControllerTest < ActionController::TestCase
session[:user] = create(:user).id
get :index
assert_response :redirect
assert_redirected_to root_path
assert_redirected_to :controller => :errors, :action => :forbidden
# Access issues list as administrator
session[:user] = create(:administrator_user).id
@ -37,7 +37,7 @@ class IssuesControllerTest < ActionController::TestCase
session[:user] = create(:user).id
get :show, :params => { :id => issue.id }
assert_response :redirect
assert_redirected_to root_path
assert_redirected_to :controller => :errors, :action => :forbidden
# Access issue as administrator
session[:user] = create(:administrator_user).id
@ -63,7 +63,7 @@ class IssuesControllerTest < ActionController::TestCase
session[:user] = create(:user).id
get :resolve, :params => { :id => issue.id }
assert_response :redirect
assert_redirected_to root_path
assert_redirected_to :controller => :errors, :action => :forbidden
# Resolve issue as administrator
session[:user] = create(:administrator_user).id
@ -93,7 +93,7 @@ class IssuesControllerTest < ActionController::TestCase
session[:user] = create(:user).id
get :ignore, :params => { :id => issue.id }
assert_response :redirect
assert_redirected_to root_path
assert_redirected_to :controller => :errors, :action => :forbidden
# Ignore issue as administrator
session[:user] = create(:administrator_user).id
@ -125,7 +125,7 @@ class IssuesControllerTest < ActionController::TestCase
session[:user] = create(:user).id
get :reopen, :params => { :id => issue.id }
assert_response :redirect
assert_redirected_to root_path
assert_redirected_to :controller => :errors, :action => :forbidden
# Reopen issue as administrator
session[:user] = create(:administrator_user).id