Module: AttachmentHelpers

Defined in:
lib/decidim/dev/test/rspec_support/attachment_helpers.rb

Overview

A collection of methods to help dealing with attachments.

Instance Method Summary collapse

Instance Method Details

#attachment_file_size(attachment) ⇒ Object

Gives the file size in an human readable form

It is intended to be used to avoid the implementation details, so that the attachment file size presentation can change more easily.



9
10
11
# File 'lib/decidim/dev/test/rspec_support/attachment_helpers.rb', line 9

def attachment_file_size(attachment)
  ActiveSupport::NumberHelper.number_to_human_size(attachment.file_size)
end