Project

General

Profile

Defect #29055 ยป fix-29055.patch

Go MAEDA, 2019-03-02 07:35

View differences:

app/controllers/search_controller.rb
37 37
    end
38 38

  
39 39
    # quick jump to an issue
40
    if (m = @question.match(/^#?(\d+)$/)) && (issue = Issue.visible.find_by_id(m[1].to_i))
40
    if !api_request? && (m = @question.match(/^#?(\d+)$/)) && (issue = Issue.visible.find_by_id(m[1].to_i))
41 41
      redirect_to issue_path(issue)
42 42
      return
43 43
    end
test/functional/search_controller_test.rb
388 388
    assert_response :success
389 389
  end
390 390

  
391
  def test_should_not_quick_jump_for_api_requests
392
    get '/search.xml', :params => {:q => '3'}
393
    assert_response :success
394
  end
395

  
391 396
  def test_large_integer
392 397
    get :index, :params => {:q => '4615713488'}
393 398
    assert_response :success
    (1-1/1)