Sha256: 260e5fc071416791b4b3d68a1d172228b00f8184a92d11be9a7511ee9ebe2935
Contents?: true
Size: 1.14 KB
Versions: 3
Compression:
Stored size: 1.14 KB
Contents
require "spec_helper" describe Uploadcare::Rails::ActionView::FormBuilder, type: :helper do before :each do @post = Post.new @form = ActionView::Helpers::FormBuilder.new(:post, @post, helper, {}) end it "should include uploader tag for name" do tag = @form.uploadcare_field :file tag.should be_kind_of(String) end it "should have role attr" do tag = @form.uploadcare_field :file, :uploadcare => {:multiple => true} tag.should have_selector("input", :role => "uploadcare-uploader") end it "should have custom data-attributes" do tag = @form.uploadcare_field :file, :data => {:custom => true} tag.should have_selector("input", "data-custom" => "true") end it "should have uploadcare namespace translated into data- attributes" do tag = @form.uploadcare_field :file, :uploadcare => {:custom => true} tag.should have_selector("input", "data-custom" => "true") end it "should override data namespace with uploadcare namespace" do tag = @form.uploadcare_field :file, :uploadcare => {:custom => true}, :data => {:custom => false} tag.should have_selector(:input, "data-custom" => "true") end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
uploadcare-rails-1.1.0 | spec/helpers/form_helpers_spec.rb |
uploadcare-rails-1.0.6 | spec/helpers/form_helpers_spec.rb |
uploadcare-rails-1.0.5 | spec/helpers/form_helpers_spec.rb |