Sha256: f1fc4c024bd7f3f33b4c50c72e9b52237f3b26fda76318bef246bbe769987a4b

Contents?: true

Size: 512 Bytes

Versions: 3

Compression:

Stored size: 512 Bytes

Contents

require 'spec_helper'

describe Gaku::Attachment do

  describe 'concerns' do
    it_behaves_like 'thrashable'
  end

  describe 'associations' do
    it { should belong_to :attachable }
  end

  describe 'validations' do
    it { should validate_presence_of :name }
    it { should validate_presence_of(:asset).on(:create) }
    it { should have_attached_file :asset }
  end

  describe '#to_s' do
    let(:attachment) { build(:attachment) }
    specify { attachment.to_s.should eq attachment.name }
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gaku-0.0.3 core/spec/models/attachment_spec.rb
gaku-0.0.2 core/spec/models/attachment_spec.rb
gaku-0.0.1 core/spec/models/attachment_spec.rb