capybara-bootstrap-datepicker 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -8
- data/lib/capybara-bootstrap-datepicker.rb +1 -1
- data/lib/capybara-bootstrap-datepicker/version.rb +1 -1
- 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: f600d38b5c30e177d3345c1ade6bef6d00c6d616
|
4
|
+
data.tar.gz: 424644e158c742510af067a37801cf39a1ff4b77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e89bd86b7f64f3f2fc58e965bf1c8921da4134a14c4f9f339e1abad8671c52269265380ffad382a5ff326aecf781fbd32c125c5f95423cdc3c83f2ec86b95d3
|
7
|
+
data.tar.gz: 3002a31ecc1486b683805c2c90d2bf793717f57c845bd9496f5489f53ed13fca7a1cbfc6d10b39f871cb365f6778ca9ff5cdde461d29436bc252e1d9bc5c22d6
|
data/README.md
CHANGED
@@ -12,10 +12,10 @@ Add this line to your application's Gemfile:
|
|
12
12
|
|
13
13
|
Or, add it into your test group
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
group :test do
|
16
|
+
gem 'capybara-bootstrap-datepicker'
|
17
|
+
...
|
18
|
+
end
|
19
19
|
|
20
20
|
And then execute:
|
21
21
|
|
@@ -30,15 +30,20 @@ The gem automatically hook itself into rspec helper using Rspec.configure.
|
|
30
30
|
## Usage
|
31
31
|
|
32
32
|
Just use this method inside your capybara test:
|
33
|
-
|
33
|
+
|
34
|
+
select_date(2.weeks.ago, from: "Label of the date input")
|
34
35
|
|
35
36
|
Or even:
|
37
|
+
|
38
|
+
select_date(Date.tomorrow, from: "Label of the date input", format: "%d/%m/%Y")
|
36
39
|
select_date("2013-05-24", xpath: "//path_to//your_date_input", datepicker: :bootstrap)
|
37
40
|
|
38
41
|
Available options are:
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
+
+ **from:** the label of your date input
|
43
|
+
+ **xpath:** the path to your date input
|
44
|
+
+ **format:** the format used to fill your date input
|
45
|
+
+ **datepicker:** the way to fill your date input (:bootstrap = by clicking the popover using [bootstrap-datepicker](https://github.com/eternicode/bootstrap-datepicker))
|
46
|
+
; by default it just fill the input date.
|
42
47
|
|
43
48
|
## Contributing
|
44
49
|
|
@@ -45,7 +45,7 @@ module Capybara
|
|
45
45
|
|
46
46
|
datepicker_years.find('.year', text: date.year).click
|
47
47
|
datepicker_months.find('.month', text: date.strftime("%b")).click
|
48
|
-
datepicker_days.find('
|
48
|
+
datepicker_days.find(:xpath, ".//*[contains(concat(' ', @class, ' '), ' day ') and not(contains(concat(' ', @class, ' '), ' old ')) and not(contains(concat(' ', @class, ' '), ' new '))]", text: date.day).click
|
49
49
|
when :jquery
|
50
50
|
raise "jQuery UI datepicker support is not implemented."
|
51
51
|
else
|
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.0.
|
4
|
+
version: 0.0.2
|
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: 2013-05-
|
11
|
+
date: 2013-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|