Skip to content

Commit ab65f30

Browse files
authored
5117 add distribution id to partner list distribution (#5140)
* Add distribution requests spec * Display the distribution's ID in the table
1 parent 917f4ad commit ab65f30

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

app/views/partners/distributions/_distribution_section.html.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<thead>
66
<tr class="border-bottom border-dark">
77
<th scope="col" class="p-4" style='width:150px'><%= date_header %></th>
8+
<th scope="col" class="p-4">ID</th>
89
<th scope="col" class="p-4">Total Items</th>
910
<th scope="col" class="p-4"><%= item_header %></th>
1011
</tr>
@@ -18,6 +19,7 @@
1819
<br>
1920
<%= print_button_to print_partners_distribution_path(dist, format: :pdf) %>
2021
</td>
22+
<td class="p-4"><%= dist.id %></td>
2123
<td class="p-4"><%= dist.line_items.total %></td>
2224
<td class="p-4 d-flex flex-wrap">
2325
<% dist.line_items.map do |item| %>

spec/requests/partners/distributions_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@
1313
subject.call
1414
expect(response).to render_template(:index)
1515
end
16+
17+
it "should display the distribution's ID" do
18+
subject.call
19+
20+
page = Nokogiri::HTML(response.body)
21+
header = page.css("table thead tr th")
22+
id_field_order = 1
23+
24+
expect(header[id_field_order].text).to eq("ID")
25+
end
1626
end
1727

1828
describe "GET #print" do

0 commit comments

Comments
 (0)