Skip to content

Commit 13b50f6

Browse files
committed
Only show exact match count when greater than zero
Only show exact matches not imported on import summary page when the count is greater than 0.
1 parent ed6f432 commit 13b50f6

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

app/views/imports/show.html.erb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,15 @@
4444
<% if import.exact_duplicate_record_count.present? %>
4545
<%= summary_list.with_row do |row| %>
4646
<%= row.with_key { "Duplicates not imported" } %>
47-
<%= row.with_value {
48-
import.exact_duplicate_record_count == 1 ?
49-
"1 record was not imported because it already exists in Mavis" :
50-
"#{import.exact_duplicate_record_count} records were not imported because they already exist in Mavis"
51-
} %>
47+
<%= row.with_value do %>
48+
<% if import.exact_duplicate_record_count.zero? %>
49+
None
50+
<% else %>
51+
<%= import.exact_duplicate_record_count == 1 ?
52+
"1 record was not imported because it already exists in Mavis" :
53+
"#{import.exact_duplicate_record_count} records were not imported because they already exist in Mavis" %>
54+
<% end %>
55+
<% end %>
5256
<% end %>
5357
<% end %>
5458

spec/features/import_child_records_with_twins_spec.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,8 @@ def and_i_upload_a_file_with_a_twin
102102
end
103103

104104
def then_i_should_see_the_import_page_with_successful_import
105-
expect(page).to have_content(
106-
"0 records were not imported because they already exist in Mavis"
107-
)
105+
expect(page).not_to have_content("already exist in Mavis")
106+
expect(page).to have_content("Duplicates not imported None")
108107
expect(Patient.count).to eq(4)
109108
end
110109

0 commit comments

Comments
 (0)