Sha256: b35b8e577967e206ebebe61707c87c9b256dc55621fbe5a665e9d0fb500b1a76

Contents?: true

Size: 1.41 KB

Versions: 10

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-association="photo_uploads" data-disposition=\"inline\" data-parent-id="#{@product.id}" data-parent-type="product"><input class="s3r-field" id="file" name="file" type="file" /><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-association="photo_uploads" data-disposition=\"inline\" data-parent-id="#{@product.id}" data-parent-type="product"><input class="s3r-field" id="file" multiple="multiple" name="file" type="file" /><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-association="photo_uploads" data-disposition=\"attachment\" data-parent-id="#{@product.id}" data-parent-type="product"><input class="s3r-field" disposition=\"attachment\" id="file" name="file" type="file" /><table class="s3r-upload-list"></table></div>}
      end
    end
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
s3_relay-0.5.1 test/helpers/s3_relay/uploads_helper_test.rb
s3_relay-0.5.0 test/helpers/s3_relay/uploads_helper_test.rb
s3_relay-0.4.2 test/helpers/s3_relay/uploads_helper_test.rb
s3_relay-0.4.1 test/helpers/s3_relay/uploads_helper_test.rb
s3_relay-0.4.0 test/helpers/s3_relay/uploads_helper_test.rb
s3_relay-0.3.2 test/helpers/s3_relay/uploads_helper_test.rb
s3_relay-0.3.1 test/helpers/s3_relay/uploads_helper_test.rb
s3_relay-0.3.0 test/helpers/s3_relay/uploads_helper_test.rb
s3_relay-0.2.0 test/helpers/s3_relay/uploads_helper_test.rb
s3_relay-0.1.0 test/helpers/s3_relay/uploads_helper_test.rb