Sha256: fb5c974e17d75f993ff403e764a33a27fb3e0e6c9a377c810c38b922778af58f

Contents?: true

Size: 908 Bytes

Versions: 2

Compression:

Stored size: 908 Bytes

Contents

require "spec_helper"

begin
  req = require 'formtastic' 
rescue Exception => e
  req = nil
end

if req
  require 'uploadcare/rails/formtastic/formtastic'
  describe "Uploadcare::Rails::Formtastic", type: :helper  do
    before :each  do
      @post = Post.new
      @form = Formtastic::FormBuilder.new(:post, @post, helper, {}, nil)
    end

    it 'should create smart uploader field' do
      tag = @form.input :file, as: :uploadcare_uploader
      tag.should have_selector("input", :role => "uploadcare-uploader")
    end

    it 'should create single uploader field' do
      tag = @form.input :file, as: :uploadcare_uploader
      tag.should have_selector("input", :role => "uploadcare-uploader")
    end

    it 'should create multiple uploader field' do
      tag = @form.input :file, as: :uploadcare_uploader
      tag.should have_selector("input", :role => "uploadcare-uploader")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
uploadcare-rails-1.0.4 spec/helpers/formtastic_spec.rb
uploadcare-rails-1.0.3 spec/helpers/formtastic_spec.rb