diff --git a/app/controllers/concerns/name_filterable.rb b/app/controllers/concerns/name_filterable.rb index 0575d817..fde03c65 100644 --- a/app/controllers/concerns/name_filterable.rb +++ b/app/controllers/concerns/name_filterable.rb @@ -23,6 +23,8 @@ def name_status_filters # @return [Integer, Array] The status value(s). def map_status_to_value(status) status = status.to_s.downcase + return nil if status == 'all' + status = 'icnafp' if status == 'icn' name_status_filters[status] || status end diff --git a/test/controllers/names_controller_test.rb b/test/controllers/names_controller_test.rb index cf4f4fe3..62ec6fe8 100644 --- a/test/controllers/names_controller_test.rb +++ b/test/controllers/names_controller_test.rb @@ -21,4 +21,11 @@ class NamesControllerTest < ActionDispatch::IntegrationTest assert name.observing?(@user) assert_redirected_to name_url(name) end + + test 'user names includes draft names' do + get user_names_url + + assert_response :success + assert_includes @response.body, names(:draft_by_contributor).name + end end diff --git a/test/fixtures/names.yml b/test/fixtures/names.yml index bd79188b..657740c1 100644 --- a/test/fixtures/names.yml +++ b/test/fixtures/names.yml @@ -3,6 +3,11 @@ unregistered: name: MyString +draft_by_contributor: + name: Testimonas draftensis + status: 5 # draft + created_by: contributor + escherichia: name: Escherichia rank: genus