Sha256: 735e57a5829b00ab6a9617f4e94765b86f6ce1f36412b7db4a410e7bbf80a552

Contents?: true

Size: 996 Bytes

Versions: 1

Compression:

Stored size: 996 Bytes

Contents

require 'spec_helper'

describe MediaMagick do
  describe ApplicationHelper do
    describe 'attachmentUploader' do
      it 'should create a div.attachmentUploader.photos' do
        album = Album.new
        album.stub(id: '12345678')

        helper.attachment_container(album, :photos) do
        end.should eq('<div class="attachmentUploader photos" data-id="12345678" data-model="Album" data-relation="photos" id="album-photos"></div>')
      end

      it 'should renders default partial if block is not given' do
        photo = AlbumPhotos.new
        photo.stub(filename: 'photo.jpg', url: 'url/photo.jpg')

        file = AlbumFiles.new
        file.stub(filename: 'file.pdf', url: 'url/file.pdf')

        album = Album.new(photos: [photo], files: [file])
        album.stub(id: '12345678')

        helper.attachment_container(album, :photos).should match(/url\/photo.jpg/)
        helper.attachment_container(album, :files).should match(/url\/file.pdf/)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
media_magick-0.0.1 spec/helpers/media_magick/application_helper_spec.rb