@@ -53,7 +53,7 @@ module Domain
53
53
let! ( :http_request ) do
54
54
stub_request ( :post , "http://example.org/hook" ) .
55
55
with ( :headers => { 'Content-Type' => 'text/plain' } , :body => 'body' ) .
56
- to_return ( :status => 302 , :body => "respbod" , :headers => { 'Content-Type' => 'text/foo, blah' } )
56
+ to_return ( :status => 200 , :body => "respbod" , :headers => { 'Content-Type' => 'text/foo, blah' } )
57
57
end
58
58
59
59
it "executes the configured request" do
@@ -70,7 +70,7 @@ module Domain
70
70
it "logs the response" do
71
71
allow ( PactBroker . logger ) . to receive ( :info )
72
72
allow ( PactBroker . logger ) . to receive ( :debug )
73
- expect ( PactBroker . logger ) . to receive ( :info ) . with ( /response.*302 / )
73
+ expect ( PactBroker . logger ) . to receive ( :info ) . with ( /response.*200 / )
74
74
expect ( PactBroker . logger ) . to receive ( :debug ) . with ( /respbod/ )
75
75
subject . execute ( options )
76
76
end
@@ -94,7 +94,7 @@ module Domain
94
94
end
95
95
96
96
it "logs the response status" do
97
- expect ( logs ) . to include "HTTP/1.0 302 "
97
+ expect ( logs ) . to include "HTTP/1.0 200 "
98
98
end
99
99
100
100
it "logs the response headers" do
@@ -140,7 +140,7 @@ module Domain
140
140
basic_auth : [ username , password ] ,
141
141
:headers => { 'Content-Type' => 'text/plain' } ,
142
142
:body => 'body' ) .
143
- to_return ( :status => 302 , :body => "respbod" , :headers => { 'Content-Type' => 'text/foo, blah' } )
143
+ to_return ( :status => 200 , :body => "respbod" , :headers => { 'Content-Type' => 'text/foo, blah' } )
144
144
end
145
145
146
146
it "uses the credentials" do
@@ -156,7 +156,7 @@ module Domain
156
156
# webmock will set the request signature scheme to 'https' _only_ if the use_ssl option is set
157
157
stub_request ( :post , "https://example.org/hook" ) .
158
158
with ( :headers => { 'Content-Type' => 'text/plain' } , :body => 'body' ) .
159
- to_return ( :status => 302 , :body => "respbod" , :headers => { 'Content-Type' => 'text/foo, blah' } )
159
+ to_return ( :status => 200 , :body => "respbod" , :headers => { 'Content-Type' => 'text/foo, blah' } )
160
160
end
161
161
162
162
it "uses SSL" do
@@ -171,7 +171,7 @@ module Domain
171
171
let! ( :http_request ) do
172
172
stub_request ( :post , "http://example.org/hook" ) .
173
173
with ( :headers => { 'Content-Type' => 'text/plain' } , :body => body . to_json ) .
174
- to_return ( :status => 302 , :body => "respbod" , :headers => { 'Content-Type' => 'text/foo, blah' } )
174
+ to_return ( :status => 200 , :body => "respbod" , :headers => { 'Content-Type' => 'text/foo, blah' } )
175
175
end
176
176
177
177
it "converts the body to JSON before submitting the request" do
@@ -186,7 +186,7 @@ module Domain
186
186
let! ( :http_request ) do
187
187
stub_request ( :post , "http://example.org/hook" ) .
188
188
with ( :headers => { 'Content-Type' => 'text/plain' } , :body => nil ) .
189
- to_return ( :status => 302 , :body => "respbod" , :headers => { 'Content-Type' => 'text/foo, blah' } )
189
+ to_return ( :status => 200 , :body => "respbod" , :headers => { 'Content-Type' => 'text/foo, blah' } )
190
190
end
191
191
192
192
it "executes the request without a body" do
@@ -201,7 +201,7 @@ module Domain
201
201
end
202
202
203
203
it "sets the response on the result" do
204
- expect ( subject . execute ( options ) . response ) . to be_instance_of ( Net ::HTTPFound )
204
+ expect ( subject . execute ( options ) . response ) . to be_instance_of ( Net ::HTTPOK )
205
205
end
206
206
end
207
207
0 commit comments