File tree 2 files changed +6
-28
lines changed
lib/pact/consumer_contract
2 files changed +6
-28
lines changed Original file line number Diff line number Diff line change 29
29
reports
30
30
Gemfile.lock
31
31
build
32
+
33
+ vendor /bundle /
Original file line number Diff line number Diff line change @@ -15,42 +15,18 @@ def to_json(options = {})
15
15
def as_json options = { }
16
16
hash = {
17
17
method : request . method ,
18
- path : path
18
+ path : request . path
19
19
}
20
- hash [ :query ] = query if request . specified? ( :query )
21
- hash [ :headers ] = headers if request . specified? ( :headers )
22
- hash [ :body ] = body if request . specified? ( :body )
20
+ hash [ :query ] = request . query if request . specified? ( :query )
21
+ hash [ :headers ] = request . headers if request . specified? ( :headers )
22
+ hash [ :body ] = request . body if request . specified? ( :body )
23
23
include_matching_rules? ? with_matching_rules ( hash ) : hash
24
24
end
25
25
26
26
private
27
27
28
28
attr_reader :request
29
29
30
- def path
31
- Pact ::Reification . from_term ( request . path )
32
- end
33
-
34
- def headers
35
- Pact ::Reification . from_term ( request . headers )
36
- end
37
-
38
- # This feels wrong to be checking the class type of the Query
39
- # Do this better somehow.
40
- def query
41
- Pact ::Reification . from_term ( request . query )
42
- end
43
-
44
- # This feels wrong to be checking the class type of the body
45
- # Do this better somehow.
46
- def body
47
- if content_type_is_form && request . body . is_a? ( Hash )
48
- URI . encode_www_form convert_hash_body_to_array_of_arrays
49
- else
50
- Pact ::Reification . from_term ( request . body )
51
- end
52
- end
53
-
54
30
def content_type_is_form
55
31
request . content_type? 'application/x-www-form-urlencoded'
56
32
end
You can’t perform that action at this time.
0 commit comments