Testing ActiveStorage attached file

11 views
Skip to first unread message

belgoros

unread,
Nov 7, 2018, 8:44:04 AM11/7/18
to rspec
Are there any guidelines, examples on how to test ActiveStorage (model, request specs) ? I'm a little bit lost with all these new AS methods:

ActiveStorage::Blob.create_after_upload!
create_before_direct_upload
fixture_file_upload

My use case is really trivial:

class Post < ApplicationRecord
  serialize
:tag_ids, Array
  validates
:title, :body, :tag_ids, presence: true


  has_one_attached
:photo
end

PostsController is just the one generated with scaffold.

Thank you.
Reply all
Reply to author
Forward
0 new messages