Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix partner view to display distribution scheduled date #4860

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/views/partners/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
<tbody>
<% @partner_distributions.each do |dist| %>
<tr>
<td><%= dist.created_at.strftime("%m/%d/%Y") %></td>
<td><%= dist.issued_at.strftime("%m/%d/%Y") %></td>
<td><%= dist.storage_location.name %></td>
<td><%= dist.line_items.total %></td>
<td class="text-right">
Expand Down
15 changes: 15 additions & 0 deletions spec/system/partner_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,21 @@
end
end
end

context "when viewing prior distributions" do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this test doesn't require any browser interactivity/javascript, it could probably be changed from a system spec to be a request spec. Because system specs are pretty slow.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, I guarantee @dorner will strongly suggest the same thing.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. 😁 Can it please be moved to a request spec?

let(:partner) do
partner = create(:partner, :approved)
partner.distributions << create(:distribution, :with_items, :past, item_quantity: 1231)
partner
end
it "displays distribution scheduled date" do
visit partner_path(partner.id)
partner.distributions.each do |distribution|
expect(page).to have_content(distribution.issued_at.strftime("%m/%d/%Y"))
expect(page).to_not have_content(distribution.created_at.strftime("%m/%d/%Y"))
end
end
end
end

describe "#new" do
Expand Down
Loading