Sha256: a4495646b6f135f34630da02a6f0a311d674f2c76131757c12a18c1a949d187f
Contents?: true
Size: 1.41 KB
Versions: 25
Compression:
Stored size: 1.41 KB
Contents
require 'rails_helper' describe MessageTrain::AttachmentsHelper do include_context 'loaded site' describe '#attachment_icon' do context 'when attachment is an image' do subject { helper.attachment_icon(image_attachment) } it { should have_tag :img, with: { src: image_attachment.attachment.url(:thumb) } } end context 'when attachment is a file' do subject { helper.attachment_icon(pdf_attachment) } it { should have_tag :span, with: { class: 'glyphicon-save-file' } } end end describe '#attachment_link' do context 'when attachment is an image' do subject { helper.attachment_link(image_attachment) } it { should have_tag :a, with: { href: '#', class: 'thumbnail', 'data-toggle' => 'modal', 'data-target' => '#attachment_preview', 'data-src' => image_attachment.attachment.url(:large), 'data-original' => image_attachment.attachment.url(:original), 'data-text' => 'Click for Original' } } end context 'when attachment is a file' do subject { helper.attachment_link(pdf_attachment) } it { should have_tag :a, with: { href: pdf_attachment.attachment.url, class: 'thumbnail' } } end end end
Version data entries
25 entries across 25 versions & 1 rubygems