Project

General

Profile

Defect #5676 ยป 5676_large_integer_search.diff

Holger Just, 2010-06-20 21:20

View differences:

app/controllers/search_controller.rb
begin; offset = params[:offset].to_time if params[:offset]; rescue; end
# quick jump to an issue
if @question.match(/^#?(\d+)$/) && Issue.visible.find_by_id($1)
if @question.match(/^#?(\d+)$/) && $1.to_i <= 2147483647 && Issue.visible.find_by_id($1)
redirect_to :controller => "issues", :action => "show", :id => $1
return
end
test/functional/search_controller_test.rb
assert_template 'index'
end
def test_large_integer
get :index, :q => '4615713488'
assert_response :success
assert_template 'index'
end
def test_tokens_with_quotes
get :index, :id => 1, :q => '"good bye" hello "bye bye"'
assert_equal ["good bye", "hello", "bye bye"], assigns(:tokens)
    (1-1/1)