Feature #16904 » 16904-issuequery-filters-add-anonymous-user.patch
| app/models/issue_query.rb | ||
|---|---|---|
|
}
|
||
|
end
|
||
|
def author_values
|
||
|
super << [l(:label_user_anonymous), "#{User.anonymous.id}"]
|
||
|
end
|
||
|
def available_columns
|
||
|
return @available_columns if @available_columns
|
||
|
@available_columns = self.class.available_columns.dup
|
||
| test/functional/queries_controller_test.rb | ||
|---|---|---|
|
:issues, :custom_fields, :custom_values,
|
||
|
:queries
|
||
|
include Redmine::I18n
|
||
|
def setup
|
||
|
User.current = nil
|
||
|
end
|
||
| ... | ... | |
|
assert_include ["Dave2 Lopper2", "5", "locked"], json
|
||
|
end
|
||
|
def test_author_filter_should_return_active_and_locked_users_grouped_by_status
|
||
|
def test_author_filter_should_return_active_and_locked_users_grouped_by_status_with_anonymous_user
|
||
|
@request.session[:user_id] = 1
|
||
|
get :filter, :params => {
|
||
|
:project_id => 1,
|
||
| ... | ... | |
|
assert_equal 'application/json', response.content_type
|
||
|
json = ActiveSupport::JSON.decode(response.body)
|
||
|
assert_equal 6, json.count
|
||
|
assert_equal 7, json.count
|
||
|
# "me" value should not be grouped
|
||
|
assert_include ["<< me >>", "me"], json
|
||
|
assert_include ["Dave Lopper", "3", "active"], json
|
||
|
assert_include ["Dave2 Lopper2", "5", "locked"], json
|
||
|
assert_include [l(:label_user_anonymous), "#{User.anonymous.id}"], json
|
||
|
end
|
||
|
def test_user_filter_should_return_active_and_locked_users_grouped_by_status
|
||