capybara-bootstrap-datepicker 0.2.2 → 0.2.3

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
  SHA256:
3
- metadata.gz: 14e0604064a5deb07db70bf98d0ae7c3e888836763259901970dcc52165f190f
4
- data.tar.gz: 05fdcca8baf0ac96047f9e9025594ef32d1a815db90dec1b480a7645527bcf63
3
+ metadata.gz: a58fbe4d6ea5403ae364eabd549da5091da1888b83f81b36b90d93a1f15a814f
4
+ data.tar.gz: 676d7b0f2ad42163a18434d77e65af2cf36fc16ed4e154654ee7133fbbba7bed
5
5
  SHA512:
6
- metadata.gz: c0023d6b004c02659825a7fcd3e146761d2b62e1888b0f65cc2fa4600753c15118e0341f87f05b8d847f4fd52e3faf6db5555b859106ea459535f55609dc9359
7
- data.tar.gz: 8c4d2500a7dedc7b6eb95b1538b1ff3bde90ace64ec7406f8e116dc3d756967eb89c21f23f1c2609bee8d73137ce6cbcca7c2404fa393e96ed50445989350368
6
+ metadata.gz: 91a0929174e0be1b6684a9174e2346778284e2324f490543d1ec1321c8a640743b4c894d3832920c64b9dad40dc4e5dfa08373a8d000384d734c52f586213cb3
7
+ data.tar.gz: c457e90f2b7777b409bffd1a0d61c59f22b800674e2073b3e1c9fe1b072e9763137c1564a0bf0bef0ab7c623978b692dba1884dd0a87fec2210a38d120c5c32a
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.7
1
+ 2.5.9
data/Gemfile.lock CHANGED
@@ -6,10 +6,11 @@ PATH
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- addressable (2.7.0)
10
- public_suffix (>= 2.0.2, < 5.0)
11
- capybara (3.29.0)
9
+ addressable (2.8.1)
10
+ public_suffix (>= 2.0.2, < 6.0)
11
+ capybara (3.38.0)
12
12
  addressable
13
+ matrix
13
14
  mini_mime (>= 0.1.3)
14
15
  nokogiri (~> 1.8)
15
16
  rack (>= 1.6.0)
@@ -23,20 +24,23 @@ GEM
23
24
  diff-lcs (1.3)
24
25
  launchy (2.4.3)
25
26
  addressable (~> 2.3)
26
- mini_mime (1.0.2)
27
- mini_portile2 (2.4.0)
28
- nokogiri (1.10.8)
29
- mini_portile2 (~> 2.4.0)
27
+ matrix (0.4.2)
28
+ mini_mime (1.1.2)
29
+ mini_portile2 (2.8.1)
30
+ nokogiri (1.14.2)
31
+ mini_portile2 (~> 2.8.0)
32
+ racc (~> 1.4)
30
33
  phantomjs (2.1.1.0)
31
34
  poltergeist (1.18.1)
32
35
  capybara (>= 2.1, < 4)
33
36
  cliver (~> 0.3.1)
34
37
  websocket-driver (>= 0.2.0)
35
- public_suffix (4.0.1)
36
- rack (2.2.3)
37
- rack-test (1.1.0)
38
- rack (>= 1.0, < 3)
39
- regexp_parser (1.6.0)
38
+ public_suffix (5.0.1)
39
+ racc (1.6.2)
40
+ rack (3.0.4.2)
41
+ rack-test (2.0.2)
42
+ rack (>= 1.3)
43
+ regexp_parser (2.7.0)
40
44
  rspec (3.9.0)
41
45
  rspec-core (~> 3.9.0)
42
46
  rspec-expectations (~> 3.9.0)
@@ -70,4 +74,4 @@ DEPENDENCIES
70
74
  rspec (~> 3.9, >= 3.9.0)
71
75
 
72
76
  BUNDLED WITH
73
- 2.1.0
77
+ 2.3.3
data/README.md CHANGED
@@ -1,11 +1,25 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/capybara-bootstrap-datepicker.svg)](http://badge.fury.io/rb/capybara-bootstrap-datepicker)
2
2
  [![Travis CI](https://travis-ci.org/akarzim/capybara-bootstrap-datepicker.svg?branch=master)](https://travis-ci.org/akarzim/capybara-bootstrap-datepicker.svg?branch=master)
3
3
 
4
+ [Bootstrap]: https://getbootstrap.com/
5
+ [bootstrap-datepicker]: https://github.com/eternicode/bootstrap-datepicker
6
+ [jQuery]: https://jquery.com/
7
+
4
8
  # Capybara::BootstrapDatepicker
5
9
 
6
- Helper for triggering date input for bootstrap-datepicker javascript library
10
+ Helper for triggering date input with the [bootstrap-datepicker] JavaScript
11
+ library.
12
+
13
+ This gem does something very simple: it allows you to trigger the [Bootstrap]
14
+ date picker to select the date you want.
15
+
16
+ ## Supported versions
7
17
 
8
- All this gem does is something very simple : allow you to trigger Bootstrap datepicker to select the date you want.
18
+ This gem has been tested with:
19
+
20
+ - [Bootstrap] 5.0.1 + [bootstrap-datepicker] 1.9.0 + [jQuery] 3.6.0
21
+ - [Bootstrap] 4.4.1 + [bootstrap-datepicker] 1.9.0 + [jQuery] 3.4.1
22
+ - [Bootstrap] 3.4.1 + [bootstrap-datepicker] 1.9.0 + [jQuery] 3.4.1
9
23
 
10
24
  ## Installation
11
25
 
@@ -32,17 +46,17 @@ Or install it yourself as:
32
46
 
33
47
  $ gem install capybara-bootstrap-datepicker
34
48
 
35
- The gem automatically hook itself into rspec helper using Rspec.configure.
49
+ The gem automatically hooks itself into RSpec helper using `RSpec.configure`.
36
50
 
37
51
  ## Usage
38
52
 
39
- Just use this method inside your capybara test:
53
+ Just use this method inside your Capybara test:
40
54
 
41
55
  ```ruby
42
56
  select_date(2.weeks.ago, from: "Label of the date input")
43
57
  ```
44
58
 
45
- Or even:
59
+ Or in a more advanced way:
46
60
 
47
61
  ```ruby
48
62
  select_date(2.weeks.ago, from: "Date", match: :prefer_exact)
@@ -51,15 +65,19 @@ select_date("2013-05-24", xpath: "//path_to//your_date_input", datepicker: :boot
51
65
  ```
52
66
 
53
67
  Available options are:
54
- + **from:** the label of your date input
55
- + **xpath:** the path to your date input
56
- + **format:** the format used to fill your date input
57
- + **datepicker:** the way to fill your date input (:bootstrap = by clicking the popover using [bootstrap-datepicker](https://github.com/eternicode/bootstrap-datepicker))
58
- ; by default it just fill the input date.
68
+
69
+ - **from**: the label of your date input
70
+ - **xpath**: the path to your date input
71
+ - **format**: the format used to fill your date input
72
+ - **match**:
73
+ - **datepicker**: the way to fill your date input
74
+ - `:bootstrap` = by clicking the popover using [bootstrap-datepicker]
75
+ - `:simple` = just fill the input date
76
+ - any extra args to find the input field
59
77
 
60
78
  ## Test
61
79
 
62
- Just run rspec in your terminal:
80
+ Just run RSpec in your terminal:
63
81
 
64
82
  $ rspec
65
83
 
@@ -4,6 +4,6 @@
4
4
  module Capybara
5
5
  module BootstrapDatepicker
6
6
  # the current version of the gem
7
- VERSION = '0.2.2'
7
+ VERSION = '0.2.3'
8
8
  end
9
9
  end
@@ -0,0 +1,56 @@
1
+ <html>
2
+ <head>
3
+ <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.0.1/css/bootstrap.min.css">
4
+ <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker3.min.css">
5
+ </head>
6
+ <body>
7
+ <div class="container">
8
+ <h1>Bootstrap 5.0 Datepicker</h1>
9
+
10
+ <form action=".">
11
+ <div class="form-group">
12
+ <label for="my-date-input">Label of my date input</label>
13
+ <div class="input-group date default-date">
14
+ <input type="text" class="form-control" id="my-date-input">
15
+ <span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
16
+ </div>
17
+ </div>
18
+
19
+ <div class="form-group">
20
+ <label for="my-localized-date-input">Label of my localized date input</label>
21
+ <div class="input-group date locale-date">
22
+ <input type="text" class="form-control" id="my-localized-date-input">
23
+ <span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
24
+ </div>
25
+ </div>
26
+
27
+ <div class="required form-group" id="cfp_start_date_input">
28
+ <span class="form-label">
29
+ <label for="registration-period-start-datapicker" class="control-label">
30
+ Start date&nbsp;
31
+ <span class="text-warning">
32
+ <abbr title="This field is required">*</abbr>
33
+ </span>
34
+ </label>
35
+ </span>
36
+ <span class="form-wrapper">
37
+ <input id="registration-period-start-datapicker" class="form-control" type="text" name="cfp[start_date]">
38
+ </span>
39
+ </div>
40
+ </form>
41
+ </div>
42
+ <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
43
+ <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.0.1/js/bootstrap.min.js"></script>
44
+ <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.min.js"></script>
45
+ <script type="text/javascript">
46
+ $('.input-group.default-date').datepicker({ format: 'yyyy-mm-dd' });
47
+ $('.input-group.locale-date').datepicker({ format: 'yyyy-mm-dd', language: 'ja' });
48
+
49
+ $('#registration-period-start-datapicker').datepicker({
50
+ format: 'yyyy-mm-dd',
51
+ minDate : '2019-03-06',
52
+ maxDate : '2019-03-12'
53
+ });
54
+ </script>
55
+ </body>
56
+ </html>
@@ -68,4 +68,16 @@ RSpec.describe 'Bootstrap Datepicker', type: :feature do
68
68
 
69
69
  it_behaves_like 'a datepicker'
70
70
  end
71
+
72
+ describe 'Boostrap 5.0' do
73
+ before :each do
74
+ Capybara.current_session.driver.visit "#{Capybara.app_host}/bootstrap-5.0.html"
75
+ end
76
+
77
+ it 'loads the page correctly', js: true do
78
+ expect(page).to have_content 'Bootstrap 5.0 Datepicker'
79
+ end
80
+
81
+ it_behaves_like 'a datepicker'
82
+ end
71
83
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-bootstrap-datepicker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - François Vantomme
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-28 00:00:00.000000000 Z
11
+ date: 2023-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -134,6 +134,7 @@ files:
134
134
  - lib/capybara/bootstrap-datepicker.rb
135
135
  - spec/features/bootstrap-3.4.html
136
136
  - spec/features/bootstrap-4.4.html
137
+ - spec/features/bootstrap-5.0.html
137
138
  - spec/features/bootstrap_datepicker_spec.rb
138
139
  - spec/spec_helper.rb
139
140
  homepage: https://github.com/akarzim/capybara-bootstrap-datepicker
@@ -155,13 +156,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
156
  - !ruby/object:Gem::Version
156
157
  version: '0'
157
158
  requirements: []
158
- rubyforge_project:
159
- rubygems_version: 2.7.6.2
159
+ rubygems_version: 3.3.3
160
160
  signing_key:
161
161
  specification_version: 4
162
162
  summary: Bootstrap datepicker helper for Capybara
163
163
  test_files:
164
164
  - spec/features/bootstrap-3.4.html
165
165
  - spec/features/bootstrap-4.4.html
166
+ - spec/features/bootstrap-5.0.html
166
167
  - spec/features/bootstrap_datepicker_spec.rb
167
168
  - spec/spec_helper.rb