tessa 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tessa/rack_upload_proxy.rb +3 -2
- data/lib/tessa/version.rb +1 -1
- data/spec/tessa/rack_upload_proxy_spec.rb +15 -0
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 291d840a45d8f48f3205cbfef4e83bf7991a93fd
         | 
| 4 | 
            +
              data.tar.gz: 5fbc8b1da0885ea3b66388c97d2dc9de4c346156
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 35899a43789fd04c913c08674b2f0e9ce9d77afb7d4f845236e39decbb6a0ceec2938ef038ef8da56626774b6b5fc8735d303cd3abe8b807c766574393a42fc7
         | 
| 7 | 
            +
              data.tar.gz: c4b05578eb0dfe0872593354234552b69de6691d36f607a628776e3aa40bc1f763ef5fc248f98767b3a2bc34973e89c1f09022959463817288dfa8b060d9a111
         | 
| @@ -3,11 +3,12 @@ module Tessa | |
| 3 3 |  | 
| 4 4 | 
             
                def call(env)
         | 
| 5 5 | 
             
                  params = env['rack.request.form_hash']
         | 
| 6 | 
            -
                  upload = Tessa::Upload.create(
         | 
| 6 | 
            +
                  upload = Tessa::Upload.create({
         | 
| 7 7 | 
             
                    name: params["name"],
         | 
| 8 8 | 
             
                    size: params["size"],
         | 
| 9 | 
            +
                    date: params["date"],
         | 
| 9 10 | 
             
                    mime_type: params["mime_type"],
         | 
| 10 | 
            -
                  )
         | 
| 11 | 
            +
                  }.reject { |k, v| v.nil? })
         | 
| 11 12 |  | 
| 12 13 | 
             
                  env['rack.session'][:tessa_upload_asset_ids] ||= []
         | 
| 13 14 | 
             
                  env['rack.session'][:tessa_upload_asset_ids] << upload.asset_id
         | 
    
        data/lib/tessa/version.rb
    CHANGED
    
    
| @@ -86,6 +86,7 @@ RSpec.describe Tessa::RackUploadProxy do | |
| 86 86 | 
             
                  {
         | 
| 87 87 | 
             
                    "name" => "my-name",
         | 
| 88 88 | 
             
                    "size" => 456,
         | 
| 89 | 
            +
                    "date" => "2020-01-01",
         | 
| 89 90 | 
             
                    "mime_type" => "plain/text",
         | 
| 90 91 | 
             
                  }
         | 
| 91 92 | 
             
                }
         | 
| @@ -100,6 +101,11 @@ RSpec.describe Tessa::RackUploadProxy do | |
| 100 101 | 
             
                  result
         | 
| 101 102 | 
             
                end
         | 
| 102 103 |  | 
| 104 | 
            +
                it "calls Tessa::Upload.create with 'date'" do
         | 
| 105 | 
            +
                  expect(Tessa::Upload).to receive(:create).with(hash_including(date: "2020-01-01"))
         | 
| 106 | 
            +
                  result
         | 
| 107 | 
            +
                end
         | 
| 108 | 
            +
             | 
| 103 109 | 
             
                it "calls Tessa::Upload.create with 'mime_type'" do
         | 
| 104 110 | 
             
                  expect(Tessa::Upload).to receive(:create).with(hash_including(mime_type: "plain/text"))
         | 
| 105 111 | 
             
                  result
         | 
| @@ -108,6 +114,15 @@ RSpec.describe Tessa::RackUploadProxy do | |
| 108 114 | 
             
                it_behaves_like "proper json return"
         | 
| 109 115 | 
             
              end
         | 
| 110 116 |  | 
| 117 | 
            +
              context "with no date param" do
         | 
| 118 | 
            +
                let(:params) { {} }
         | 
| 119 | 
            +
             | 
| 120 | 
            +
                it "calls Tessa::Upload.create without 'date'" do
         | 
| 121 | 
            +
                  expect(Tessa::Upload).to_not receive(:create).with(hash_including(:date))
         | 
| 122 | 
            +
                  result
         | 
| 123 | 
            +
                end
         | 
| 124 | 
            +
              end
         | 
| 125 | 
            +
             | 
| 111 126 | 
             
              context "with existing session" do
         | 
| 112 127 | 
             
                let(:session) {
         | 
| 113 128 | 
             
                  {
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: tessa
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.6. | 
| 4 | 
            +
              version: 0.6.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Justin Powell
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2015-08- | 
| 12 | 
            +
            date: 2015-08-26 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: faraday
         |