+ assert_redirected_to login_path(:referer => resolve_issue_path(issue))
+
+ # Resolve issue as normal user
+ session[:user] = create(:user).id
+ get :resolve, :params => { :id => issue.id }
+ assert_response :redirect
+ assert_redirected_to :controller => :errors, :action => :forbidden
+
+ # Resolve issue as administrator
+ session[:user] = create(:administrator_user).id
+ get :resolve, :params => { :id => issue.id }
+ assert_response :redirect
+ assert_equal true, issue.reload.resolved?
+
+ issue.reopen!
+
+ # Resolve issue as moderator
+ session[:user] = create(:moderator_user).id
+ get :resolve, :params => { :id => issue.id }
+ assert_response :redirect
+ assert_equal true, issue.reload.resolved?