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 +4 -4
- data/README.md +1 -1
- data/lib/cucumber/sammies/step_definitions/form_steps.rb +23 -0
- data/lib/cucumber/sammies/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: 2b3130bf6e99e26faf47e30d1679e5076beed569
|
4
|
+
data.tar.gz: f32229fce4bf1645aaae3baf1eebab1025595870
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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.
|
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-
|
11
|
+
date: 2017-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|