<feed xmlns='http://www.w3.org/2005/Atom'>
<title>cccms/test/controllers/shared_previews_controller_test.rb, branch master</title>
<subtitle>[no description]</subtitle>
<id>https://erdgeist.org/gitweb/cccms/atom?h=master</id>
<link rel='self' href='https://erdgeist.org/gitweb/cccms/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://erdgeist.org/gitweb/cccms/'/>
<updated>2026-07-14T12:31:18Z</updated>
<entry>
<title>Retire wipe_draft! and find_or_create_draft from production code</title>
<updated>2026-07-14T12:31:18Z</updated>
<author>
<name>erdgeist</name>
<email>erdgeist@erdgeist.org</email>
</author>
<published>2026-07-14T12:31:18Z</published>
<link rel='alternate' type='text/html' href='https://erdgeist.org/gitweb/cccms/commit/?id=cca0e57b21d506cd341b927984bcb68f0e461783'/>
<id>urn:sha1:cca0e57b21d506cd341b927984bcb68f0e461783</id>
<content type='text'>
Both had already lost their reason to exist as production API:
wipe_draft!'s one remaining callsite (nodes#show) was removed two
sessions ago, and find_or_create_draft had zero production callers
left at all -- confirmed by a fresh grep, not assumed -- every one of
its ~65 call sites was test setup, unrelated to what those tests
actually cover.

wipe_draft! is deleted outright, along with its two tests -- the
lock/draft/autosave cleanup it silently performed already has
explicit, always-visible manual equivalents (Unlock, Discard
Autosave, Destroy Draft), so nothing real is lost.

find_or_create_draft moves to test_helper.rb as a plain method on
ActiveSupport::TestCase, alongside the create_node_with_draft/
create_node_with_published_page helpers already living there --
extending the framework's own designated test-extension point
rather than reopening the Node model from test code. Its three
tests of real dispatch behavior (idempotency on repeat calls, and
raising when a second user contends for the lock) are kept, since
~65 other tests depend on this helper actually working correctly;
only the call syntax changed, from node.find_or_create_draft(user)
to find_or_create_draft(node, user).
</content>
</entry>
<entry>
<title>Fix shared preview redirecting to admin for an ordinary new draft</title>
<updated>2026-07-13T15:09:45Z</updated>
<author>
<name>erdgeist</name>
<email>erdgeist@erdgeist.org</email>
</author>
<published>2026-07-13T15:09:45Z</published>
<link rel='alternate' type='text/html' href='https://erdgeist.org/gitweb/cccms/commit/?id=40adeec1bcc6fa276d765e3b9c37e781c64a48c1'/>
<id>urn:sha1:40adeec1bcc6fa276d765e3b9c37e781c64a48c1</id>
<content type='text'>
superseded/currently_public used published_at presence as a proxy
for page-row relevance, but published_at is carried forward onto
every new draft descended from previously-published content
(Page#clone_attributes_from, Node#save_draft!) -- so it read true
for any draft on an already-published node, whether or not that
specific draft had ever gone live itself. Compare draft_id/head_id
identity directly instead; no timestamp involved. A stale
(superseded) link now redirects to the live public page rather than
an admin URL an anonymous holder can't reach anyway.
</content>
</entry>
</feed>
