summaryrefslogtreecommitdiff
path: root/test/models
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-06-30 19:15:22 +0200
committererdgeist <erdgeist@erdgeist.org>2026-06-30 19:22:24 +0200
commita7a6ad786eeb9f94f7882462bccbdd31e1bb4743 (patch)
treeecc0a17db462065b27270f7e593a8244e24c8846 /test/models
parent31ca8e93efa860d73918b57ddddeaedf9917b22d (diff)
Phase 1: standalone events, external_url on nodes
- Migration: node_id nullable on events and occurrences, add title/description/is_primary to events, external_url to nodes - Existing events marked is_primary: true (were all 1:1 with nodes) - Node: has_one :event -> has_many :events - Event: belongs_to :node optional, validates title presence for standalone events, is_primary uniqueness scoped to node_id, display_title helper falling back through node title - Occurrence: belongs_to :node optional, summary falls back to event.display_title - nodes_helper: event_information uses events.first (interim; will be replaced in Phase 3 event UI) - Tests: fix node.event -> node.events.first in event_test
Diffstat (limited to 'test/models')
-rw-r--r--test/models/event_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/models/event_test.rb b/test/models/event_test.rb
index f310af8..d85aadd 100644
--- a/test/models/event_test.rb
+++ b/test/models/event_test.rb
@@ -74,17 +74,17 @@ class EventTest < ActiveSupport::TestCase
74 74
75 assert_equal "2009-12-24T15:23:42".to_time, scoped_occurrences[51].start_time 75 assert_equal "2009-12-24T15:23:42".to_time, scoped_occurrences[51].start_time
76 assert_equal "2009-12-24T20:05:23".to_time, scoped_occurrences[51].end_time 76 assert_equal "2009-12-24T20:05:23".to_time, scoped_occurrences[51].end_time
77 assert_equal @cal_node.event, scoped_occurrences[51].event 77 assert_equal @cal_node.events.first, scoped_occurrences[51].event
78 assert_equal @cal_node, scoped_occurrences[51].node 78 assert_equal @cal_node, scoped_occurrences[51].node
79 79
80 assert_equal "2009-03-19T15:23:42".to_time, scoped_occurrences[11].start_time 80 assert_equal "2009-03-19T15:23:42".to_time, scoped_occurrences[11].start_time
81 assert_equal "2009-03-19T20:05:23".to_time, scoped_occurrences[11].end_time 81 assert_equal "2009-03-19T20:05:23".to_time, scoped_occurrences[11].end_time
82 assert_equal @cal_node.event, scoped_occurrences[11].event 82 assert_equal @cal_node.events.first, scoped_occurrences[11].event
83 assert_equal @cal_node, scoped_occurrences[11].node 83 assert_equal @cal_node, scoped_occurrences[11].node
84 84
85 assert_equal "2009-01-01T15:23:42".to_time, scoped_occurrences[0].start_time 85 assert_equal "2009-01-01T15:23:42".to_time, scoped_occurrences[0].start_time
86 assert_equal "2009-01-01T20:05:23".to_time, scoped_occurrences[0].end_time 86 assert_equal "2009-01-01T20:05:23".to_time, scoped_occurrences[0].end_time
87 assert_equal @cal_node.event, scoped_occurrences[11].event 87 assert_equal @cal_node.events.first, scoped_occurrences[11].event
88 assert_equal @cal_node, scoped_occurrences[11].node 88 assert_equal @cal_node, scoped_occurrences[11].node
89 end 89 end
90 90
@@ -111,4 +111,4 @@ class EventTest < ActiveSupport::TestCase
111 chaosradio_days = scoped_occurrences.map {|x| x.start_time.day} 111 chaosradio_days = scoped_occurrences.map {|x| x.start_time.day}
112 assert_equal expected_days, chaosradio_days 112 assert_equal expected_days, chaosradio_days
113 end 113 end
114end \ No newline at end of file 114end