-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ee2465
commit b2f3b08
Showing
3 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# frozen_string_literal: true | ||
|
||
require "rails_helper" | ||
|
||
RSpec.describe "Order show" do | ||
let(:facility) { create(:setup_facility) } | ||
let(:account) { create(:setup_account) } | ||
let!(:instrument) { create(:setup_instrument, :always_available, :daily_booking, facility:) } | ||
let(:reservation_order) { create(:setup_order, product: instrument, account:) } | ||
let!(:reservation) do | ||
create( | ||
:purchased_reservation, | ||
product: instrument, | ||
order_detail: reservation_order.order_details.first, | ||
reserve_start_at: 1.day.from_now, | ||
reserve_end_at: 4.days.from_now | ||
) | ||
end | ||
let(:facility_administrator) { create(:user, :facility_administrator, facility:) } | ||
|
||
before do | ||
login_as facility_administrator | ||
visit facility_order_path(facility, reservation_order) | ||
end | ||
|
||
describe "reservation duration" do | ||
it "is correctly displayed in days" do | ||
# Reserved is the third column | ||
expect(all("tbody tr").first.all("td")[2]).to have_text("3", exact: true) | ||
end | ||
end | ||
|
||
describe "reservation actual" do | ||
it "is correctly displayed in days" do | ||
# Actual is the fourth column | ||
expect(all("tbody tr").first.all("td")[3]).to have_text("0", exact: true) | ||
end | ||
end | ||
end |