chore: Breadcrumb on ticket edit page
This commit is contained in:
@@ -28,7 +28,7 @@ class Promoter::EventsControllerTest < ActionDispatch::IntegrationTest
|
||||
|
||||
test "should duplicate an event with ticket types" do
|
||||
sign_in @promoter
|
||||
|
||||
|
||||
# Create ticket types for the event
|
||||
ticket_type1 = TicketType.create!(
|
||||
name: "Standard Ticket",
|
||||
@@ -39,7 +39,7 @@ class Promoter::EventsControllerTest < ActionDispatch::IntegrationTest
|
||||
sale_end_at: @event.start_time - 1.hour,
|
||||
event: @event
|
||||
)
|
||||
|
||||
|
||||
ticket_type2 = TicketType.create!(
|
||||
name: "VIP Ticket",
|
||||
description: "A VIP ticket for the event with special access",
|
||||
@@ -49,27 +49,27 @@ class Promoter::EventsControllerTest < ActionDispatch::IntegrationTest
|
||||
sale_end_at: @event.start_time - 1.hour,
|
||||
event: @event
|
||||
)
|
||||
|
||||
|
||||
# Verify that ticket types were created successfully
|
||||
assert ticket_type1.valid?
|
||||
assert ticket_type2.valid?
|
||||
|
||||
|
||||
# Duplicate the event
|
||||
assert_difference('Event.count', 1) do
|
||||
assert_difference("Event.count", 1) do
|
||||
post duplicate_promoter_event_path(@event), params: { clone_ticket_types: "true" }
|
||||
end
|
||||
|
||||
|
||||
# Check that the new event was created
|
||||
assert_redirected_to edit_promoter_event_path(Event.last)
|
||||
assert_equal "Événement dupliqué avec succès! Vous pouvez maintenant modifier les détails de l'événement copié.", flash[:notice]
|
||||
|
||||
|
||||
# Check that the new event has the correct attributes
|
||||
new_event = Event.last
|
||||
assert_equal "Copie de #{@event.name}", new_event.name
|
||||
assert_equal "draft", new_event.state
|
||||
assert_equal @event.venue_name, new_event.venue_name
|
||||
assert_equal @event.venue_address, new_event.venue_address
|
||||
|
||||
|
||||
# Check that ticket types were duplicated
|
||||
assert_equal 2, new_event.ticket_types.count
|
||||
assert_equal "Standard Ticket", new_event.ticket_types.find_by(name: "Standard Ticket").name
|
||||
@@ -78,7 +78,7 @@ class Promoter::EventsControllerTest < ActionDispatch::IntegrationTest
|
||||
|
||||
test "should duplicate an event without ticket types" do
|
||||
sign_in @promoter
|
||||
|
||||
|
||||
# Create ticket types for the event
|
||||
ticket_type1 = TicketType.create!(
|
||||
name: "Standard Ticket",
|
||||
@@ -89,7 +89,7 @@ class Promoter::EventsControllerTest < ActionDispatch::IntegrationTest
|
||||
sale_end_at: @event.start_time - 1.hour,
|
||||
event: @event
|
||||
)
|
||||
|
||||
|
||||
ticket_type2 = TicketType.create!(
|
||||
name: "VIP Ticket",
|
||||
description: "A VIP ticket for the event with special access",
|
||||
@@ -99,27 +99,27 @@ class Promoter::EventsControllerTest < ActionDispatch::IntegrationTest
|
||||
sale_end_at: @event.start_time - 1.hour,
|
||||
event: @event
|
||||
)
|
||||
|
||||
|
||||
# Verify that ticket types were created successfully
|
||||
assert ticket_type1.valid?
|
||||
assert ticket_type2.valid?
|
||||
|
||||
|
||||
# Duplicate the event without ticket types
|
||||
assert_difference('Event.count', 1) do
|
||||
assert_difference("Event.count", 1) do
|
||||
post duplicate_promoter_event_path(@event), params: { clone_ticket_types: "false" }
|
||||
end
|
||||
|
||||
|
||||
# Check that the new event was created
|
||||
assert_redirected_to edit_promoter_event_path(Event.last)
|
||||
assert_equal "Événement dupliqué avec succès! Vous pouvez maintenant modifier les détails de l'événement copié.", flash[:notice]
|
||||
|
||||
|
||||
# Check that the new event has the correct attributes
|
||||
new_event = Event.last
|
||||
assert_equal "Copie de #{@event.name}", new_event.name
|
||||
assert_equal "draft", new_event.state
|
||||
assert_equal @event.venue_name, new_event.venue_name
|
||||
assert_equal @event.venue_address, new_event.venue_address
|
||||
|
||||
|
||||
# Check that ticket types were NOT duplicated
|
||||
assert_equal 0, new_event.ticket_types.count
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user