Sha256: 712405f1d12031c4efeaad8b31c5a7eae66d88b4f6fc5689ad1bfdf8d4b36894
Contents?: true
Size: 1.41 KB
Versions: 12
Compression:
Stored size: 1.41 KB
Contents
require "test_helper" describe S3Relay::UploadsHelper do before { @product = FactoryGirl.create(:product) } describe "#s3_relay_field" do describe "without options" do it do s3_relay_field(@product, :photo_uploads) .must_equal %Q{<div class="s3r-container" data-parent-type="product" data-parent-id="#{@product.id}" data-association="photo_uploads" data-disposition=\"inline\"><input type="file" name="file" id="file" class="s3r-field" /><table class="s3r-upload-list"></table></div>} end end describe "with multiple: true" do it do s3_relay_field(@product, :photo_uploads, multiple: true) .must_equal %Q{<div class="s3r-container" data-parent-type="product" data-parent-id="#{@product.id}" data-association="photo_uploads" data-disposition=\"inline\"><input type="file" name="file" id="file" multiple="multiple" class="s3r-field" /><table class="s3r-upload-list"></table></div>} end end describe "with disposition: attachment" do it do s3_relay_field(@product, :photo_uploads, disposition: :attachment) .must_equal %Q{<div class="s3r-container" data-parent-type="product" data-parent-id="#{@product.id}" data-association="photo_uploads" data-disposition=\"attachment\"><input type="file" name="file" id="file" disposition=\"attachment\" class="s3r-field" /><table class="s3r-upload-list"></table></div>} end end end end
Version data entries
12 entries across 12 versions & 3 rubygems