capybara-select-2 0.3.0 → 0.3.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: 1270129638518b209d629a987b5998c6e80ee997
4
- data.tar.gz: b8681b7193f7b789d5c900115474007103fb819c
3
+ metadata.gz: 708b9d0d575ee79bdee004f8c2e03206bdf64208
4
+ data.tar.gz: f6fdc06ba262c22e5b0a158cef9dd32dac54343c
5
5
  SHA512:
6
- metadata.gz: b7b8e06ff700058b083008769bc926d50c0fe24aacfc5507736c7eff9f099f9185f3dcd36acb93d171e60234d727d2ca32ee848a850f46e578d4d652536ab30c
7
- data.tar.gz: 6bb11c66346bd4b26d5416548c74939c16013d26b40cd41bd7ecb1d009b5d9fadcdb4f3dff463b2ab20a3c2c8e8e84e9a2371b2ae2737f09530854fe5cd412ef
6
+ metadata.gz: c0c3defb50c2ace12d153faf81293e590c55b6d8a8fb8a09d492ba2f0da056e15bcaad9994acc61ec6d360105ed532889d641b5fcce071a18679c1ef2ed4a4b8
7
+ data.tar.gz: 2e3d53bf184fbfdaa6bcd2afc0179c3ce167d147c4e89da35ae3e376a5d422bc7cdb5679137b2c2a3dafc9b50ae21a41dd53cb70b3125610c6692df156461234
data/.travis.yml CHANGED
@@ -5,7 +5,10 @@ rvm:
5
5
  - 2.4.2
6
6
  before_install: gem install bundler -v 1.16.4
7
7
  env:
8
- - MOZ_HEADLESS=1
8
+ global:
9
+ - MOZ_HEADLESS=1
10
+ - CC_TEST_REPORTER_ID=e82aca58fe4e7eae020799b830f8df7dd35ec67f7476078d4fe97ae884be8f84
11
+ - GECKODRIVER_VERSION=0.21.0
9
12
  addons:
10
13
  firefox: latest
11
14
  apt:
@@ -15,9 +18,14 @@ addons:
15
18
  - libqt5webkit5-dev
16
19
  - qtdeclarative5-dev
17
20
  before_install:
18
- - export GECKODRIVER_VERSION=0.21.0
19
21
  - wget https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz
20
22
  - mkdir geckodriver
21
23
  - tar -xzf geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz -C geckodriver
22
24
  - export PATH=$PATH:$PWD/geckodriver
23
- script: xvfb-run bundle exec rspec
25
+ before_script:
26
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
27
+ - chmod +x ./cc-test-reporter
28
+ - ./cc-test-reporter before-build
29
+ script: COVERAGE=1 xvfb-run bundle exec rspec
30
+ after_script:
31
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
data/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  # CapybaraSelect2 for select2 version 2/3/4
2
- !!! CapybaraSelect2 detects version select2 automatically
2
+ !!! CapybaraSelect2 detects select2 version automatically
3
3
 
4
4
  [![Build Status](https://travis-ci.org/Hirurg103/capybara_select2.svg?branch=master)](https://travis-ci.org/Hirurg103/capybara_select2)
5
+ [![Maintainability](https://api.codeclimate.com/v1/badges/28e692c7efa07aadbe98/maintainability)](https://codeclimate.com/github/Hirurg103/capybara_select2/maintainability)
6
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/28e692c7efa07aadbe98/test_coverage)](https://codeclimate.com/github/Hirurg103/capybara_select2/test_coverage)
5
7
 
6
8
  ## Installation
7
9
 
@@ -35,4 +35,5 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency "capybara-webkit", "~> 1.15"
36
36
  spec.add_development_dependency "puma", "~> 3.12"
37
37
  spec.add_development_dependency "pry", "~> 0.11.0"
38
+ spec.add_development_dependency "simplecov", "~> 0.16"
38
39
  end
@@ -25,25 +25,26 @@ module CapybaraSelect2
25
25
  container.find('.select2-container')
26
26
  end
27
27
 
28
- version = Utils.detect_version(container)
28
+ select2_version = Utils.detect_select2_version(container)
29
29
 
30
30
  open_select = {
31
31
  '2' => ".select2-choice, .select2-search-field",
32
32
  '3' => ".select2-choice, .select2-search-field",
33
33
  '4' => ".select2-selection"
34
- }.fetch(version)
34
+ }.fetch(select2_version)
35
35
 
36
36
  search_input = {
37
37
  '2' => ".select2-dropdown-open input.select2-focused",
38
- '3' => ".select2-dropdown-open input.select2-input",
38
+ '3' => ".select2-drop-active input.select2-input," + # single
39
+ ".select2-dropdown-open input.select2-input", # multi
39
40
  '4' => ".select2-container--open input.select2-search__field"
40
- }.fetch(version)
41
+ }.fetch(select2_version)
41
42
 
42
43
  option = {
43
44
  '2' => ".select2-container-active .select2-result",
44
45
  '3' => ".select2-drop-active .select2-result",
45
46
  '4' => ".select2-results .select2-results__option"
46
- }.fetch(version)
47
+ }.fetch(select2_version)
47
48
 
48
49
  values.each do |value|
49
50
  container.find(open_select).click
@@ -1,7 +1,7 @@
1
1
  module CapybaraSelect2
2
2
  module Utils
3
3
 
4
- def self.detect_version(container)
4
+ def self.detect_select2_version(container)
5
5
  if container['class'] =~ /^select2\s/
6
6
  '4'
7
7
  elsif container['id'] =~ /^s2id_/
@@ -1,3 +1,3 @@
1
1
  module CapybaraSelect2
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-select-2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dzmitry Kavalionak
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-12 00:00:00.000000000 Z
11
+ date: 2018-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: 0.11.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: simplecov
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '0.16'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '0.16'
139
153
  description:
140
154
  email:
141
155
  - dzm.kov@gmail.com