capybara 2.15.0 → 2.15.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4e019a48b2f87598c4c62ba40e9fc12291b8f538
4
- data.tar.gz: 2625bd193da4cdab59284069d1b5b2cdd8430b89
3
+ metadata.gz: 4eff01a08419c2e76c521c460193065f256f6fe4
4
+ data.tar.gz: 588eeea7fc4088e2e470bd4d573056be00782248
5
5
  SHA512:
6
- metadata.gz: 682fdf80248b4da8fefe635e74f1ad57ead7559198853f67500fa9a8487f3464904d3ad622a38f0d4f73dc60e40db04cab8d965c0e3bc6a8a6467f115241d418
7
- data.tar.gz: 80945a70a931293fd4929c756b39b340d5e78c20a5f547eab84264505fdbe5c9fb3461c08b9e8fc3839fcfff8e741f40b9272ae285578a33fea47f28179b86a9
6
+ metadata.gz: 1281d86fc6e0ff8533bc4e9d0232adf51b9ce7c33a48a9eba5842e2b24271dbf909efab1c80e9b14ca7ca6861bc1f489d0cb094cce0f8d822f3a387f60c6672f
7
+ data.tar.gz: d713cafa706d2ddbd23dc05524128fff444a2040d602d8352b23acd0e718c8bb2a844ca36a72d2decc7aa1016aaa8cd75d579754457d5260add9aa797d536c6a
data/History.md CHANGED
@@ -1,6 +1,14 @@
1
+ # Version 2.15.1
2
+
3
+ Release date: 2017-08-04
4
+
5
+ ### Fixed
6
+
7
+ * `attach_file` with no extension/MIME type when using the `:rack_test` driver [Thomas Walpole]
8
+
1
9
  # Version 2.15.0
2
10
 
3
- Release data: unreleased
11
+ Release date: 2017-08-04
4
12
 
5
13
  ### Added
6
14
 
@@ -12,9 +20,11 @@ Release data: unreleased
12
20
  than waiting for one to pass/fail before checking the second. Will make `#or` more performant and confirm
13
21
  both conditions are true "simultaneously" for `and`. [Thomas Walpole]
14
22
  If you still want the
23
+ * Default filter values are now included in error descriptions [Thomas Walpole]
15
24
  * Add `Session#refresh` [Thomas Walpole]
16
25
  * Loosened restrictions on where `Session#within_window` can be called from [Thomas Walpole]
17
26
  * Switched from `mime-types` dependency to `mini_mime` [Jason Frey]
27
+
18
28
  # Version 2.14.4
19
29
 
20
30
  Release date: 2017-06-27
@@ -42,7 +42,8 @@ class Capybara::RackTest::Form < Capybara::RackTest::Node
42
42
  if (value = field['value']).to_s.empty?
43
43
  NilUploadedFile.new
44
44
  else
45
- Rack::Test::UploadedFile.new(value, MiniMime.lookup_by_filename(value).content_type)
45
+ mime_info = MiniMime.lookup_by_filename(value)
46
+ Rack::Test::UploadedFile.new(value, (mime_info && mime_info.content_type).to_s)
46
47
  end
47
48
  merge_param!(params, field['name'].to_s, file)
48
49
  else
@@ -0,0 +1 @@
1
+ ThisFileHAsNoExtension
@@ -4,6 +4,7 @@ Capybara::SpecHelper.spec "#attach_file" do
4
4
  @test_file_path = File.expand_path('../fixtures/test_file.txt', File.dirname(__FILE__))
5
5
  @another_test_file_path = File.expand_path('../fixtures/another_test_file.txt', File.dirname(__FILE__))
6
6
  @test_jpg_file_path = File.expand_path('../fixtures/capybara.jpg', File.dirname(__FILE__))
7
+ @no_extension_file_path = File.expand_path('../fixtures/no_extension', File.dirname(__FILE__))
7
8
  @session.visit('/form')
8
9
  end
9
10
 
@@ -57,6 +58,12 @@ Capybara::SpecHelper.spec "#attach_file" do
57
58
  expect(@session).to have_content('image/jpeg')
58
59
  end
59
60
 
61
+ it "should not break when uploading a file without extension" do
62
+ @session.attach_file "Single Document", @no_extension_file_path
63
+ @session.click_button 'Upload Single'
64
+ expect(@session).to have_content(File.read(@no_extension_file_path))
65
+ end
66
+
60
67
  it "should not break when using HTML5 multiple file input" do
61
68
  @session.attach_file "Multiple Documents", @test_file_path
62
69
  @session.click_button('Upload Multiple')
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Capybara
3
- VERSION = '2.15.0'
3
+ VERSION = '2.15.1'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.15.0
4
+ version: 2.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Walpole
@@ -346,6 +346,7 @@ files:
346
346
  - lib/capybara/session/matchers.rb
347
347
  - lib/capybara/spec/fixtures/another_test_file.txt
348
348
  - lib/capybara/spec/fixtures/capybara.jpg
349
+ - lib/capybara/spec/fixtures/no_extension
349
350
  - lib/capybara/spec/fixtures/test_file.txt
350
351
  - lib/capybara/spec/public/jquery-ui.js
351
352
  - lib/capybara/spec/public/jquery.js