test_for_26091.patch

Marius BALTEANU, 2018-06-29 09:10

Download (1.52 KB)

View differences:

test/functional/queries_controller_test.rb
605 605
    assert_include ["eCookbook - 2.0", "3", "open"], json
606 606
  end
607 607

  
608
  def test_filter_without_project_id_should_return_filter_values
608
  def test_version_filter_without_project_id_should_return_all_visible_fixed_versions
609
    # Remove "jsmith" user from "Private child of eCookbook" project
610
    Project.find(5).memberships.find_by(:user_id => 2).destroy
611

  
609 612
    @request.session[:user_id] = 2
610 613
    get :filter, :params => {
611 614
        :name => 'fixed_version_id'
......
614 617
    assert_response :success
615 618
    assert_equal 'application/json', response.content_type
616 619
    json = ActiveSupport::JSON.decode(response.body)
620

  
621
    # response includes visible version
622
    assert_include ["eCookbook Subproject 1 - 2.0", "4", "open"], json
623
    assert_include ["eCookbook - 0.1", "1", "closed"], json
624
    # response includes systemwide visible version
617 625
    assert_include ["OnlineStore - Systemwide visible version", "7", "open"], json
626
    # response doesn't include non visible version
627
    refute_includes ["Private child of eCookbook - Private Version of public subproject", "6", "open"], json
618 628
  end
619 629

  
620 630
  def test_subproject_filter_time_entries_with_project_id_should_return_filter_values