refactor(events): replace parties concept with events throughout the application
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com> This commit refactors the entire application to replace the 'parties' concept with 'events'. All controllers, models, views, and related files have been updated to reflect this change. The parties table has been replaced with an events table, and all related functionality has been updated accordingly.
This commit is contained in:
54
test/models/ticket_test.rb
Normal file → Executable file
54
test/models/ticket_test.rb
Normal file → Executable file
@@ -14,10 +14,10 @@ class TicketTest < ActiveSupport::TestCase
|
||||
password_confirmation: "password123"
|
||||
)
|
||||
|
||||
party = Party.create!(
|
||||
name: "Valid Party Name",
|
||||
slug: "valid-party-name",
|
||||
description: "Valid description for the party that is long enough",
|
||||
event = Event.create!(
|
||||
name: "Valid event Name",
|
||||
slug: "valid-event-name",
|
||||
description: "Valid description for the event that is long enough",
|
||||
latitude: 48.8566,
|
||||
longitude: 2.3522,
|
||||
venue_name: "Test Venue",
|
||||
@@ -33,7 +33,7 @@ class TicketTest < ActiveSupport::TestCase
|
||||
sale_start_at: Time.current,
|
||||
sale_end_at: Time.current + 1.day,
|
||||
requires_id: false,
|
||||
party: party
|
||||
event: event
|
||||
)
|
||||
|
||||
ticket = Ticket.new(user: user, ticket_type: ticket_type)
|
||||
@@ -87,8 +87,8 @@ class TicketTest < ActiveSupport::TestCase
|
||||
assert_equal :belongs_to, association.macro
|
||||
end
|
||||
|
||||
test "should have one party through ticket_type" do
|
||||
association = Ticket.reflect_on_association(:party)
|
||||
test "should have one event through ticket_type" do
|
||||
association = Ticket.reflect_on_association(:event)
|
||||
assert_equal :has_one, association.macro
|
||||
assert_equal :ticket_type, association.options[:through]
|
||||
end
|
||||
@@ -108,10 +108,10 @@ class TicketTest < ActiveSupport::TestCase
|
||||
password_confirmation: "password123"
|
||||
)
|
||||
|
||||
party = Party.create!(
|
||||
name: "Valid Party Name",
|
||||
slug: "valid-party-name",
|
||||
description: "Valid description for the party that is long enough",
|
||||
event = Event.create!(
|
||||
name: "Valid event Name",
|
||||
slug: "valid-event-name",
|
||||
description: "Valid description for the event that is long enough",
|
||||
latitude: 48.8566,
|
||||
longitude: 2.3522,
|
||||
venue_name: "Test Venue",
|
||||
@@ -127,7 +127,7 @@ class TicketTest < ActiveSupport::TestCase
|
||||
sale_start_at: Time.current,
|
||||
sale_end_at: Time.current + 1.day,
|
||||
requires_id: false,
|
||||
party: party
|
||||
event: event
|
||||
)
|
||||
|
||||
ticket = Ticket.new(
|
||||
@@ -147,10 +147,10 @@ class TicketTest < ActiveSupport::TestCase
|
||||
password_confirmation: "password123"
|
||||
)
|
||||
|
||||
party = Party.create!(
|
||||
name: "Valid Party Name",
|
||||
slug: "valid-party-name",
|
||||
description: "Valid description for the party that is long enough",
|
||||
event = Event.create!(
|
||||
name: "Valid event Name",
|
||||
slug: "valid-event-name",
|
||||
description: "Valid description for the event that is long enough",
|
||||
latitude: 48.8566,
|
||||
longitude: 2.3522,
|
||||
venue_name: "Test Venue",
|
||||
@@ -166,7 +166,7 @@ class TicketTest < ActiveSupport::TestCase
|
||||
sale_start_at: Time.current,
|
||||
sale_end_at: Time.current + 1.day,
|
||||
requires_id: false,
|
||||
party: party
|
||||
event: event
|
||||
)
|
||||
|
||||
ticket = Ticket.new(
|
||||
@@ -185,10 +185,10 @@ class TicketTest < ActiveSupport::TestCase
|
||||
password_confirmation: "password123"
|
||||
)
|
||||
|
||||
party = Party.create!(
|
||||
name: "Valid Party Name",
|
||||
slug: "valid-party-name",
|
||||
description: "Valid description for the party that is long enough",
|
||||
event = Event.create!(
|
||||
name: "Valid event Name",
|
||||
slug: "valid-event-name",
|
||||
description: "Valid description for the event that is long enough",
|
||||
latitude: 48.8566,
|
||||
longitude: 2.3522,
|
||||
venue_name: "Test Venue",
|
||||
@@ -204,7 +204,7 @@ class TicketTest < ActiveSupport::TestCase
|
||||
sale_start_at: Time.current,
|
||||
sale_end_at: Time.current + 1.day,
|
||||
requires_id: false,
|
||||
party: party
|
||||
event: event
|
||||
)
|
||||
|
||||
ticket = Ticket.new(
|
||||
@@ -223,10 +223,10 @@ class TicketTest < ActiveSupport::TestCase
|
||||
password_confirmation: "password123"
|
||||
)
|
||||
|
||||
party = Party.create!(
|
||||
name: "Valid Party Name",
|
||||
slug: "valid-party-name",
|
||||
description: "Valid description for the party that is long enough",
|
||||
event = Event.create!(
|
||||
name: "Valid event Name",
|
||||
slug: "valid-event-name",
|
||||
description: "Valid description for the event that is long enough",
|
||||
latitude: 48.8566,
|
||||
longitude: 2.3522,
|
||||
venue_name: "Test Venue",
|
||||
@@ -242,7 +242,7 @@ class TicketTest < ActiveSupport::TestCase
|
||||
sale_start_at: Time.current,
|
||||
sale_end_at: Time.current + 1.day,
|
||||
requires_id: false,
|
||||
party: party
|
||||
event: event
|
||||
)
|
||||
|
||||
ticket = Ticket.new(
|
||||
|
||||
Reference in New Issue
Block a user