Project

General

Profile

Feature #16904 » 16904-issuequery-filters-add-anonymous-user-v2.patch

Go MAEDA, 2018-11-03 08:38

View differences:

app/models/query.rb
534 534
    author_values = []
535 535
    author_values << ["<< #{l(:label_me)} >>", "me"] if User.current.logged?
536 536
    author_values += users.sort_by(&:status).collect{|s| [s.name, s.id.to_s, l("status_#{User::LABEL_BY_STATUS[s.status]}")] }
537
    author_values << [l(:label_user_anonymous), User.anonymous.id.to_s]
537 538
    author_values
538 539
  end
539 540

  
test/functional/queries_controller_test.rb
671 671
    assert_equal 'application/json', response.content_type
672 672
    json = ActiveSupport::JSON.decode(response.body)
673 673

  
674
    assert_equal 6, json.count
674
    assert_equal 7, json.count
675 675
    # "me" value should not be grouped
676 676
    assert_include ["<< me >>", "me"], json
677 677
    assert_include ["Dave Lopper", "3", "active"], json
678 678
    assert_include ["Dave2 Lopper2", "5", "locked"], json
679
    assert_include ["Anonymous", "#{User.anonymous.id}"], json
679 680
  end
680 681

  
681 682
  def test_user_filter_should_return_active_and_locked_users_grouped_by_status
(2-2/3)