cucumber-sammies 0.1.1 → 0.1.2

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: ad1a61c559f37d8924f68d5b07ba90af4b4cf4de
4
- data.tar.gz: 915dc6786ea5add4cd7e5fc037caf3b88fc1d81d
3
+ metadata.gz: 2b3130bf6e99e26faf47e30d1679e5076beed569
4
+ data.tar.gz: f32229fce4bf1645aaae3baf1eebab1025595870
5
5
  SHA512:
6
- metadata.gz: f6d112211ab84bc13082e96888c6cbae533e4b8238aadc98e0760c4beae121f0c87c59af63f60ba0a731e856211ed6b0db962ac53d2c2d975ebc8b7933256067
7
- data.tar.gz: 96aa6bda9fc40f7d081250e31cc042f24e806fc778fd6d342f7ff840dcc050a77b4eb229f1cc34ab8d7cd3c87af0a8a3b22bf87d1bb8cc0efb8f8f330f253473
6
+ metadata.gz: ca9c7b76ab132244d4c7cdd82b6ccc9566d1edcca3fbe236e2cf9300e6d7ec7c66626709121dcd1d444a0937054bbf79ab4a89ca072a9559a41dd5e8576d8fc5
7
+ data.tar.gz: cd184acca4477f66cf8e75ff4f7ff9d1e7c0a9dc388168b58624b0d5eec4a8af3b0a49edb44121fd2756029f428a2238d5412b59f4aa228ba07d4547d778f8f5
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  ![Cucumber Sandwhiches](./sammies.jpg)
8
8
 
9
- Simple & tasty Cucumber step definitions for your Rails application(https://github.com/makandra/spreewald). Many of these steps were originally created by [Spreewald](https://github.com/makandra/spreewald).
9
+ Simple & tasty Cucumber step definitions for your Rails application. Many of these steps were originally created by [Spreewald](https://github.com/makandra/spreewald).
10
10
 
11
11
  ## Installation
12
12
 
@@ -50,3 +50,26 @@ end
50
50
  When /^(?:|I )fill in "([^"]*)" (?:with|for) "([^"]*)"$/ do |field, value|
51
51
  fill_in(field, :with => value)
52
52
  end
53
+
54
+ Then /^nothing should be selected for "([^"]*)"$/ do |field|
55
+ select = find_field(field)
56
+ begin
57
+ selected_option = select.find(:xpath, ".//option[@selected = 'selected']") || select.all(:css, 'option').first
58
+ value = selected_option ? selected_option.value : nil
59
+ value.should be_blank
60
+ rescue Capybara::ElementNotFound
61
+ end
62
+ end
63
+
64
+ # Checks for the presence of an option in a select
65
+ Then /^"([^"]*)" should( not)? be an option for "([^"]*)"$/ do |value, negate, field|
66
+ xpath = ".//option[text() = '#{value}']"
67
+ if negate
68
+ begin
69
+ field_labeled(field).find(:xpath, xpath).should_not be_present
70
+ rescue Capybara::ElementNotFound
71
+ end
72
+ else
73
+ field_labeled(field).find(:xpath, xpath).should be_present
74
+ end
75
+ end
@@ -1,5 +1,5 @@
1
1
  module Cucumber
2
2
  module Sammies
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-sammies
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Kirst
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-27 00:00:00.000000000 Z
11
+ date: 2017-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler