selectivity-rails 0.1.0 → 0.1.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 +4 -4
- data/README.md +4 -4
- data/lib/selectivity/rails/version.rb +1 -1
- data/lib/selectivity/rspec.rb +6 -6
- 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: be50481d16bf14f238518779badded04ccdbe9d2
|
4
|
+
data.tar.gz: 88a188828613cb175e04b29257b8efb38d19097c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cf790d61d3262e39487332e5852bdcca4fdcfea7bd05ac9310755bd3ce84bdcbdcec077832624a1af5d44e1c8f07fc9be518f12669250662034dfc280c26e2a
|
7
|
+
data.tar.gz: 7892d92e1ea8a247d3aa150bdfba1b5f2f55cc9f21b933630397adabca55d0d64aaa557c343e65b63b89ffee35196b4fd6e75591433567da1af6402af4445503
|
data/README.md
CHANGED
@@ -94,13 +94,13 @@ selectivity_select(value, options = {})
|
|
94
94
|
selectivity_unselect(value, options = {})
|
95
95
|
```
|
96
96
|
|
97
|
-
Both methods require `from: '...'` inside `options` hash.
|
97
|
+
Both methods require `from: '...'` inside `options` hash that is either CSS path or field's label (requires `for` attribute!).
|
98
98
|
|
99
99
|
### Example usage
|
100
100
|
To handle single select:
|
101
101
|
|
102
102
|
```ruby
|
103
|
-
selectivity_select('Netherlands', from: '
|
103
|
+
selectivity_select('Netherlands', from: 'Your country')
|
104
104
|
selectivity_unselect('Netherlands', from: '#country')
|
105
105
|
selectivity_select('Poland', from: '#country')
|
106
106
|
```
|
@@ -108,11 +108,11 @@ selectivity_select('Poland', from: '#country')
|
|
108
108
|
To handle multiple select:
|
109
109
|
|
110
110
|
```ruby
|
111
|
-
selectivity_select('Netherlands', 'Russia', 'Spain', from: '
|
111
|
+
selectivity_select('Netherlands', 'Russia', 'Spain', from: 'Countries list')
|
112
112
|
# or, by single value:
|
113
113
|
selectivity_select('Poland', from: '#countries')
|
114
114
|
|
115
|
-
selectivity_unselect('Russia', 'Spain', from: '
|
115
|
+
selectivity_unselect('Russia', 'Spain', from: 'Countries list')
|
116
116
|
# or, by single value:
|
117
117
|
selectivity_unselect('Netherlands', from: '#countries')
|
118
118
|
```
|
data/lib/selectivity/rspec.rb
CHANGED
@@ -12,7 +12,7 @@ module Selectivity
|
|
12
12
|
items = multiselect?(input) ? args.unshift(value).uniq : [value]
|
13
13
|
|
14
14
|
items.each do |item|
|
15
|
-
select(input, item)
|
15
|
+
select!(input, item)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -27,9 +27,9 @@ module Selectivity
|
|
27
27
|
|
28
28
|
items.each do |item|
|
29
29
|
if multiselect?(input)
|
30
|
-
unselect_multiple(input, item)
|
30
|
+
unselect_multiple!(input, item)
|
31
31
|
else
|
32
|
-
unselect_single(input)
|
32
|
+
unselect_single!(input)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
@@ -48,7 +48,7 @@ module Selectivity
|
|
48
48
|
input.first('.selectivity-multiple-input-container').present?
|
49
49
|
end
|
50
50
|
|
51
|
-
def select(input, item)
|
51
|
+
def select!(input, item)
|
52
52
|
input.click
|
53
53
|
|
54
54
|
within 'div.selectivity-dropdown' do
|
@@ -58,11 +58,11 @@ module Selectivity
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
-
def unselect_single(input)
|
61
|
+
def unselect_single!(input)
|
62
62
|
input.first('.selectivity-single-selected-item-remove').click
|
63
63
|
end
|
64
64
|
|
65
|
-
def unselect_multiple(input, value)
|
65
|
+
def unselect_multiple!(input, value)
|
66
66
|
input.first('.selectivity-multiple-selected-item', text: value)
|
67
67
|
.first('.selectivity-multiple-selected-item-remove')
|
68
68
|
.click
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selectivity-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konrad Jurkowski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|