Skip to content

Commit

Permalink
Show days in Order Detail modal (#5033)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeticiaErrandonea authored Feb 19, 2025
1 parent eb2fc37 commit 434c97e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/services/order_details/param_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def self.permitted_attributes
:reserve_start_min,
:reserve_start_meridian,
:duration_mins,
:duration_days,
:actual_start_date,
:actual_start_hour,
:actual_start_min,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
.controls
%label  
= time_select r, :reserve_start, minute_step: reservation.product.reserve_interval
= r.input :duration_mins, input_html: { class: "timeinput" }, error: false
- if reservation.product.daily_booking?
= r.input :duration_days, input_html: { value: r.object.duration_days || 1 }
- else
= r.input :duration_mins, input_html: { class: "timeinput" }, error: false
- else
= r.label :reserve_start_date
= reservation.reserve_to_s
Expand Down
11 changes: 11 additions & 0 deletions spec/system/admin/order_show_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,15 @@
expect(all("tbody tr").first.all("td")[3]).to have_text("0", exact: true)
end
end

describe "manage modal", :js do
before do
click_link(reservation_order.order_details.first.to_s)
wait_for_ajax
end

it "shows the duration days field" do
expect(page).to have_field("Duration Days", with: "3")
end
end
end

0 comments on commit 434c97e

Please sign in to comment.