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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8251efd9d4e25987dd0704a7b24f28dac8d29620
4
- data.tar.gz: 5500c81dd663327791f2ff5a3f9e0e5e1eb98b99
3
+ metadata.gz: 291d840a45d8f48f3205cbfef4e83bf7991a93fd
4
+ data.tar.gz: 5fbc8b1da0885ea3b66388c97d2dc9de4c346156
5
5
  SHA512:
6
- metadata.gz: 18870a22878208b5af37c96080789ae3e0f9e61fb49f2cf66b42a1e96dc5c28070b7a191ef1879a28c5e4f97db4591da1023c019b1007894dc94ca1f714ac733
7
- data.tar.gz: a6b338c14d1eccc9e0e9571393417b73f77eabb7b5b2c78aff3f4ed84b56e53b009ae9845f8548e53071acca635bfc7e8b5b58a9e3847f7dce6dd1f923bd9bf2
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
@@ -1,3 +1,3 @@
1
1
  module Tessa
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
@@ -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.0
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-24 00:00:00.000000000 Z
12
+ date: 2015-08-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday