Skip to content

Commit e2f876c

Browse files
authored
Merge pull request #304 from seq-code/names-regression
Fix regression on /names/user returning empty list
2 parents ecd082f + ece317d commit e2f876c

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

app/controllers/concerns/name_filterable.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ def name_status_filters
2323
# @return [Integer, Array<Integer>] The status value(s).
2424
def map_status_to_value(status)
2525
status = status.to_s.downcase
26+
return nil if status == 'all'
27+
2628
status = 'icnafp' if status == 'icn'
2729
name_status_filters[status] || status
2830
end

test/controllers/names_controller_test.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,11 @@ class NamesControllerTest < ActionDispatch::IntegrationTest
2121
assert name.observing?(@user)
2222
assert_redirected_to name_url(name)
2323
end
24+
25+
test 'user names includes draft names' do
26+
get user_names_url
27+
28+
assert_response :success
29+
assert_includes @response.body, names(:draft_by_contributor).name
30+
end
2431
end

test/fixtures/names.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
unregistered:
44
name: MyString
55

6+
draft_by_contributor:
7+
name: Testimonas draftensis
8+
status: 5 # draft
9+
created_by: contributor
10+
611
escherichia:
712
name: Escherichia
813
rank: genus

0 commit comments

Comments
 (0)