diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-21 15:39:56 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-21 15:39:56 +0200 |
| commit | cc4659a308590be083065f19df8571efc345052a (patch) | |
| tree | d53a3b89670333d2b12662fcdc41b4d130c4d5d9 /test/models | |
| parent | bd7863dbeffc2d5b41a58f8138e5691b60fc63f3 (diff) | |
Remove Page#update_assets
Only caller left was the sort_images action removed last commit.
Kept alive only as a test-setup convenience for diff_against
coverage, which is what it actually was -- an implicit API with no
deliberate contract, sitting there for anyone to call. Rewrote the
one test to set up its fixture state directly via related_assets
rather than through a method whose real job was already done.
Diffstat (limited to 'test/models')
| -rw-r--r-- | test/models/page_test.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/models/page_test.rb b/test/models/page_test.rb index 1f924f9..98a00d2 100644 --- a/test/models/page_test.rb +++ b/test/models/page_test.rb | |||
| @@ -309,11 +309,15 @@ class PageTest < ActiveSupport::TestCase | |||
| 309 | 309 | ||
| 310 | kept_asset = Asset.create!(:upload_file_name => "kept.png", :upload_content_type => "image/png", :upload_file_size => 1) | 310 | kept_asset = Asset.create!(:upload_file_name => "kept.png", :upload_content_type => "image/png", :upload_file_size => 1) |
| 311 | removed_asset = Asset.create!(:upload_file_name => "removed.pdf", :upload_content_type => "application/pdf", :upload_file_size => 1) | 311 | removed_asset = Asset.create!(:upload_file_name => "removed.pdf", :upload_content_type => "application/pdf", :upload_file_size => 1) |
| 312 | n.head.update_assets([kept_asset.id, removed_asset.id]) | 312 | n.head.related_assets.delete_all |
| 313 | n.head.related_assets.create!(:asset_id => kept_asset.id, :position => 1) | ||
| 314 | n.head.related_assets.create!(:asset_id => removed_asset.id, :position => 2) | ||
| 313 | 315 | ||
| 314 | d2 = find_or_create_draft(n, @user1) | 316 | d2 = find_or_create_draft(n, @user1) |
| 315 | added_asset = Asset.create!(:upload_file_name => "added.png", :upload_content_type => "image/png", :upload_file_size => 1) | 317 | added_asset = Asset.create!(:upload_file_name => "added.png", :upload_content_type => "image/png", :upload_file_size => 1) |
| 316 | d2.update_assets([kept_asset.id, added_asset.id]) | 318 | d2.related_assets.delete_all |
| 319 | d2.related_assets.create!(:asset_id => kept_asset.id, :position => 1) | ||
| 320 | d2.related_assets.create!(:asset_id => added_asset.id, :position => 2) | ||
| 317 | d2.save! | 321 | d2.save! |
| 318 | 322 | ||
| 319 | diff = d2.diff_against(n.head) | 323 | diff = d2.diff_against(n.head) |
