Sha256: 6c8f67d08ce4555b4cbdae2bc889b9bf3de50603b630a9be4f7366720965e36f
Contents?: true
Size: 1.02 KB
Versions: 9
Compression:
Stored size: 1.02 KB
Contents
require 'spec_helper' module Alchemy describe EssenceFile do let(:attachment) { build_stubbed(:attachment) } let(:essence) { EssenceFile.new(attachment: attachment) } it_behaves_like "an essence" do let(:essence) { EssenceFile.new } let(:ingredient_value) { attachment } end describe '#attachment_url' do subject { essence.attachment_url } it "returns the download attachment url." do should match(/\/attachment\/#{attachment.id}\/download\/#{attachment.file_name}/) end context 'without attachment assigned' do let(:attachment) { nil } it { should be_nil } end end describe '#preview_text' do it "returns the attachment's name as preview text" do essence.preview_text.should == attachment.name end context "with no attachment assigned" do it "returns empty string" do essence.attachment = nil essence.preview_text.should == '' end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems