Skip to content

Commit

Permalink
Merge pull request #1285 from bgeuken/issue_1261
Browse files Browse the repository at this point in the history
[webui] Fix NoMethodError for /home/requests page (issue #1261)
  • Loading branch information
adrianschroeter committed Oct 21, 2015
2 parents 8dbae8a + 11398f8 commit f207f8c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/app/controllers/webui/user_controller.rb
Expand Up @@ -92,7 +92,7 @@ def requests
}
sorting_field = sortable_fields[params[:iSortCol_0].to_i]
sorting_field ||= :created_at
sorting_dir = params[:sSortDir_0].to_sym
sorting_dir = params[:sSortDir_0].try(:to_sym)
sorting_dir = :asc unless ["asc", "desc"].include?(params[:sSortDir_0])
@requests = @displayed_user.requests(params[:sSearch])
@requests_count = @requests.clone.count
Expand Down
9 changes: 9 additions & 0 deletions src/api/test/functional/webui/request_controller_test.rb
Expand Up @@ -273,6 +273,15 @@ def test_requests_display_as_king
visit_requests
end

def test_requests
get "/home/requests.json"
assert_response :success
result = ActiveSupport::JSON.decode(@response.body)
assert_equal 2, result["sEcho"]
assert_equal 0, result["iTotalRecords"]
assert_equal [], result["aaData"]
end

def test_succesful_comment_creation
login_Iggy to: request_show_path(1)
fill_in 'body', with: 'Comment Body'
Expand Down

0 comments on commit f207f8c

Please sign in to comment.