capybara-bootstrap-datepicker 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/Gemfile.lock +17 -13
- data/README.md +29 -11
- data/lib/capybara-bootstrap-datepicker/version.rb +1 -1
- data/spec/features/bootstrap-5.0.html +56 -0
- data/spec/features/bootstrap_datepicker_spec.rb +12 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a58fbe4d6ea5403ae364eabd549da5091da1888b83f81b36b90d93a1f15a814f
|
4
|
+
data.tar.gz: 676d7b0f2ad42163a18434d77e65af2cf36fc16ed4e154654ee7133fbbba7bed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91a0929174e0be1b6684a9174e2346778284e2324f490543d1ec1321c8a640743b4c894d3832920c64b9dad40dc4e5dfa08373a8d000384d734c52f586213cb3
|
7
|
+
data.tar.gz: c457e90f2b7777b409bffd1a0d61c59f22b800674e2073b3e1c9fe1b072e9763137c1564a0bf0bef0ab7c623978b692dba1884dd0a87fec2210a38d120c5c32a
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.5.
|
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.
|
10
|
-
public_suffix (>= 2.0.2, <
|
11
|
-
capybara (3.
|
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
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
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 (
|
36
|
-
|
37
|
-
rack
|
38
|
-
|
39
|
-
|
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.
|
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
|
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
|
-
|
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
|
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
|
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
|
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
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
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
|
80
|
+
Just run RSpec in your terminal:
|
63
81
|
|
64
82
|
$ rspec
|
65
83
|
|
@@ -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
|
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.
|
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:
|
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
|
-
|
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
|