def test_index
# Access issues list without login
get issues_path
- assert_response :redirect
assert_redirected_to login_path(:referer => issues_path)
# Access issues list as normal user
session_for(create(:user))
get issues_path
- assert_response :redirect
assert_redirected_to :controller => :errors, :action => :forbidden
# Access issues list as administrator
# Access issue without login
get issue_path(:id => issue)
- assert_response :redirect
assert_redirected_to login_path(:referer => issue_path(issue))
# Access issue as normal user
session_for(create(:user))
get issue_path(:id => issue)
- assert_response :redirect
assert_redirected_to :controller => :errors, :action => :forbidden
# Access issue as administrator
# Access issue without login
get issue_path(:id => issue)
- assert_response :redirect
assert_redirected_to login_path(:referer => issue_path(issue))
# Access issue as normal user
session_for(create(:user))
get issue_path(:id => issue)
- assert_response :redirect
assert_redirected_to :controller => :errors, :action => :forbidden
# Access issue as moderator
# Resolve issue as normal user
session_for(create(:user))
post resolve_issue_path(:id => issue)
- assert_response :redirect
assert_redirected_to :controller => :errors, :action => :forbidden
# Resolve issue as administrator
# Resolve issue as normal user
session_for(create(:user))
post resolve_issue_path(:id => issue)
- assert_response :redirect
assert_redirected_to :controller => :errors, :action => :forbidden
# Resolve issue as moderator
# Ignore issue as normal user
session_for(create(:user))
post ignore_issue_path(:id => issue)
- assert_response :redirect
assert_redirected_to :controller => :errors, :action => :forbidden
# Ignore issue as administrator
# Ignore issue as normal user
session_for(create(:user))
post ignore_issue_path(:id => issue)
- assert_response :redirect
assert_redirected_to :controller => :errors, :action => :forbidden
# Ignore issue as moderator
# Reopen issue as normal user
session_for(create(:user))
post reopen_issue_path(:id => issue)
- assert_response :redirect
assert_redirected_to :controller => :errors, :action => :forbidden
# Reopen issue as administrator
# Reopen issue as normal user
session_for(create(:user))
post reopen_issue_path(:id => issue)
- assert_response :redirect
assert_redirected_to :controller => :errors, :action => :forbidden
# Reopen issue as moderator