Sha256: c1d40e6721c304c8433122fa9865a540350d8b59c6ce7055fc614d5a2bd5d11a
Contents?: true
Size: 863 Bytes
Versions: 27
Compression:
Stored size: 863 Bytes
Contents
require 'spec_helper' describe 'alchemy/essences/_essence_file_view' do let(:file) { File.new(File.expand_path('../../../fixtures/image with spaces.png', __FILE__)) } let(:attachment) { mock_model('Attachment', file: file, name: 'image', file_name: 'Image') } let(:essence) { Alchemy::EssenceFile.new(attachment: attachment) } let(:content) { Alchemy::Content.new(essence: essence) } context 'without attachment' do let(:essence) { Alchemy::EssenceFile.new(attachment: nil) } it "renders nothing" do render content, content: content expect(rendered).to eq('') end end context 'with attachment' do it "renders a link to download the attachment" do render content, content: content expect(rendered).to have_selector("a.file_link[href='/attachment/#{attachment.id}/download']") end end end
Version data entries
27 entries across 27 versions & 2 rubygems