cucumber-http 0.2.0 → 0.4.0

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
- SHA1:
3
- metadata.gz: a65c8016b80419b4fbb509b025be4a22705db47e
4
- data.tar.gz: c20b6b1e287040a6b34dc6bf9652e0020fca274d
2
+ SHA256:
3
+ metadata.gz: 760307f677ade8fcdc3a4b6629f7143e311377f2856d57664f0a4ccfed60fa24
4
+ data.tar.gz: 68e7faacc18737c3ef9ceb560ae4f362610dfeaf92a4fa08dd0723c2ef36827b
5
5
  SHA512:
6
- metadata.gz: a8274df33bf7ec034b59e7719727abd58177ed319ace5865e7123cba57ae42adcc74752d7781a6832c62631287930cc906ac3dfab27b33a042d33680b08ac49e
7
- data.tar.gz: 1a8db76e85b2e024de27de2ddb788bd9501d25bf2f78bb0da259b81c71f4352137cb811f22faa0b497136703cc43a0937507995086538eba0589ac993f6de499
6
+ metadata.gz: 8500cc4964f737ee94d3a28ceb1f10c1b2996e29171f04219ba7e0ed0039b996190a4d1ec57bbaae56d5bdf1eb8ae5a0422440f69561b6398cb1ab645651967d
7
+ data.tar.gz: 9373aad646952bac2bb998744238f5ff7f143531c385df8e4cf391f429fe2560af3c37f6c60ad66b985cd99f0ecf2366701b2c3d284ea2438c4c5951be205e2f
data/README.md CHANGED
@@ -38,7 +38,7 @@ Feature: Test the UDB3 labels API
38
38
  Background:
39
39
  Given I am using the UDB3 development environment
40
40
  And I am authorized as user "centraal_beheerder"
41
- And I send and accept JSON
41
+ And I send "application/json" and accept "application/ld+json"
42
42
 
43
43
  @labelcreate
44
44
  Scenario: Create label
@@ -66,6 +66,22 @@ Then /^the elapsed time should be less than (#{CAPTURE_FLOAT}) seconds?$/
66
66
  Given /^I set headers?:$/
67
67
  ```
68
68
 
69
+ ```ruby
70
+ Given /^I send "(.*?)"$/
71
+ ```
72
+
73
+ ```ruby
74
+ Given /^I accept "(.*?)"$/
75
+ ```
76
+
77
+ ```ruby
78
+ Given /^I send and accept "(.*?)"$/
79
+ ```
80
+
81
+ ```ruby
82
+ Given /^I send "(.*?)" and accept "(.*?)"$/
83
+ ```
84
+
69
85
  ```ruby
70
86
  Given /^I send "(.*?)" and accept (XML|JSON)$/
71
87
  ```
@@ -122,12 +138,12 @@ Examples for testing the [REST API](https://apidoc.uitdatabank.be) of
122
138
 
123
139
  Creating an organizer with a random name:
124
140
  ```ruby
125
- When /^I(?: have)? created? an organizer with a random name of (#{CAPTURE_INTEGER}) characters?$/ do |characters|
141
+ When /^I create an organizer with a random name of (#{CAPTURE_INTEGER}) characters?$/ do |characters|
126
142
  name = Faker::Lorem.characters(characters)
127
143
  steps %Q{
128
144
  Given I am using the UDB3 development environment
129
145
  And I am authorized as user "centraal_beheerder"
130
- And I send and accept JSON
146
+ And I send and accept "application/json"
131
147
  When I set the JSON request payload to:
132
148
  """
133
149
  {"mainLanguage":"nl","website":"https://www.#{name}.be","name":"#{name}","contact":[]}
@@ -139,12 +155,12 @@ end
139
155
 
140
156
  Creating a role with a random name:
141
157
  ```ruby
142
- When /^I(?: have)? created? a role with a random name of (#{CAPTURE_INTEGER}) characters?$/ do |characters|
158
+ When /^I create a role with a random name of (#{CAPTURE_INTEGER}) characters?$/ do |characters|
143
159
  name = Faker::Lorem.characters(characters)
144
160
  steps %Q{
145
161
  Given I am using the UDB3 development environment
146
162
  And I am authorized as user "centraal_beheerder"
147
- And I send and accept JSON
163
+ And I send and accept "application/json"
148
164
  When I set the JSON request payload to:
149
165
  """
150
166
  { "name": "#{name}" }
@@ -5,6 +5,36 @@ Given /^I set headers?:$/ do |hdrs|
5
5
  hdrs.rows_hash.each { |name, value| add_header(name, value) }
6
6
  end
7
7
 
8
+ Given /^I send "(.*?)"$/ do |content_type|
9
+ steps %Q{
10
+ Given I set headers:
11
+ | Content-Type | #{content_type} |
12
+ }
13
+ end
14
+
15
+ Given /^I accept "(.*?)"$/ do |accept_type|
16
+ steps %Q{
17
+ Given I set headers:
18
+ | Accept | #{accept_type} |
19
+ }
20
+ end
21
+
22
+ Given /^I send and accept "(.*?)"$/ do |type|
23
+ steps %Q{
24
+ Given I set headers:
25
+ | Content-Type | #{type} |
26
+ | Accept | #{type} |
27
+ }
28
+ end
29
+
30
+ Given /^I send "(.*?)" and accept "(.*?)"$/ do |content_type, accept_type|
31
+ steps %Q{
32
+ Given I set headers:
33
+ | Content-Type | #{content_type} |
34
+ | Accept | #{accept_type} |
35
+ }
36
+ end
37
+
8
38
  Given /^I send "(.*?)" and accept (XML|JSON)$/ do |content_type, accept_type|
9
39
  steps %Q{
10
40
  Given I set headers:
@@ -1,5 +1,5 @@
1
1
  module Cucumber
2
2
  module Http
3
- VERSION = "0.2.0"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kristof Willaert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-10 00:00:00.000000000 Z
11
+ date: 2022-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.8'
47
+ version: '2.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.8'
54
+ version: '2.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: nokogiri
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -110,7 +110,7 @@ dependencies:
110
110
  version: '1.9'
111
111
  description: Cucumber steps to easily test external XML and JSON APIs
112
112
  email:
113
- - kristof.willaert@cultuurnet.be
113
+ - kristof.willaert@publiq.be
114
114
  executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
@@ -150,8 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  - !ruby/object:Gem::Version
151
151
  version: '0'
152
152
  requirements: []
153
- rubyforge_project:
154
- rubygems_version: 2.5.2.3
153
+ rubygems_version: 3.1.2
155
154
  signing_key:
156
155
  specification_version: 4
157
156
  summary: Cucumber steps to easily test XML and JSON APIs