diff --git a/Gemfile.lock b/Gemfile.lock index 5c2a234..731f245 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -174,6 +174,7 @@ GEM erubi (1.13.1) faker (3.5.2) i18n (>= 1.8.11, < 2) + ffi (1.17.2) ffi (1.17.2-aarch64-linux-gnu) ffi (1.17.2-arm64-darwin) ffi (1.17.2-x86_64-darwin) diff --git a/test/models/action_text_attachment_test.rb b/test/models/action_text_attachment_test.rb index bb3483d..f1fb7c4 100644 --- a/test/models/action_text_attachment_test.rb +++ b/test/models/action_text_attachment_test.rb @@ -24,10 +24,10 @@ class ActionTextAttachmentTest < ActiveSupport::TestCase end test "lookup invalid sgid for an attachable requiring a valid sgid" do - # Make room instance attachable for testing purposes - room = rooms(:pets).tap { |r| r.extend ActionText::Attachable } - - message, signature = rooms(:pets).attachable_sgid.split("--") + # A Room is not attachable; mint the sgid an attachable would carry + # (`ActionText::Attachable#attachable_sgid` is exactly this call) so + # the lookup is exercised on a signature that does not verify. + message, signature = rooms(:pets).to_sgid(expires_in: nil, for: ActionText::Attachable::LOCATOR_NAME).to_s.split("--") html = %Q() node = ActionText::Fragment.wrap(html).find_all(ActionText::Attachment.tag_name).first