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

Version Path
s3_relay-0.6.2 test/helpers/s3_relay/uploads_helper_test.rb
s3_relay-0.6.1 test/helpers/s3_relay/uploads_helper_test.rb
mongoid-direct-s3-upload-0.1.7 test/helpers/s3_relay/uploads_helper_test.rb
mongoid-direct-s3-upload-0.1.6 test/helpers/s3_relay/uploads_helper_test.rb
mongoid-direct-s3-upload-0.1.5 test/helpers/s3_relay/uploads_helper_test.rb
mongoid-direct-s3-upload-0.1.4 test/helpers/s3_relay/uploads_helper_test.rb
mongoid-direct-s3-upload-0.1.3 test/helpers/s3_relay/uploads_helper_test.rb
mongoid-direct-s3-upload-0.1.2 test/helpers/s3_relay/uploads_helper_test.rb
mongoid-direct-s3-upload-0.1.1 test/helpers/s3_relay/uploads_helper_test.rb
mongoid-direct-s3-upload-0.1.0 test/helpers/s3_relay/uploads_helper_test.rb
mongoid_direct_s3_upload-0.1.0 test/helpers/s3_relay/uploads_helper_test.rb
s3_relay-0.6.0 test/helpers/s3_relay/uploads_helper_test.rb