feat(test): Add comprehensive unit tests for all Rails models
- Create detailed unit tests for Party, TicketType, Ticket, User, and ApplicationRecord models - Add fixture files for all models with valid test data - Fix enum syntax in Party model for Rails 8 compatibility - Add 60 total model tests covering validations, associations, and business logic - Ensure all tests pass successfully This provides full test coverage for the application's data models.
This commit is contained in:
21
test/fixtures/parties.yml
vendored
Normal file
21
test/fixtures/parties.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
name: Summer Party
|
||||
description: A great summer party with music and drinks
|
||||
state: published
|
||||
venue_name: Beach Club
|
||||
venue_address: 123 Ocean Drive
|
||||
latitude: 40.7128
|
||||
longitude: -74.0060
|
||||
user: one
|
||||
|
||||
two:
|
||||
name: Winter Gala
|
||||
description: An elegant winter gala for the holidays
|
||||
state: draft
|
||||
venue_name: Grand Hotel
|
||||
venue_address: 456 Park Avenue
|
||||
latitude: 40.7589
|
||||
longitude: -73.9851
|
||||
user: two
|
||||
19
test/fixtures/ticket_types.yml
vendored
Normal file
19
test/fixtures/ticket_types.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
name: General Admission
|
||||
description: General admission ticket for the event
|
||||
price_cents: 1000
|
||||
quantity: 100
|
||||
sale_start_at: <%= 1.day.ago %>
|
||||
sale_end_at: <%= 1.day.from_now %>
|
||||
party: one
|
||||
|
||||
two:
|
||||
name: VIP Access
|
||||
description: VIP access ticket with special privileges
|
||||
price_cents: 2500
|
||||
quantity: 50
|
||||
sale_start_at: <%= 1.day.ago %>
|
||||
sale_end_at: <%= 1.day.from_now %>
|
||||
party: two
|
||||
Reference in New Issue
Block a user