@@ -175,10 +175,7 @@ module Domain
175
175
end
176
176
end
177
177
178
- context "when a username and password are specified" do
179
-
180
- let ( :username ) { 'username' }
181
- let ( :password ) { 'password' }
178
+ describe "when a username and password are specified" do
182
179
183
180
let! ( :http_request_with_basic_auth ) do
184
181
stub_request ( :post , "http://example.org/hook" ) .
@@ -189,9 +186,24 @@ module Domain
189
186
to_return ( :status => 200 , :body => "respbod" , :headers => { 'Content-Type' => 'text/foo, blah' } )
190
187
end
191
188
192
- it "uses the credentials" do
193
- subject . execute ( pact , options )
194
- expect ( http_request_with_basic_auth ) . to have_been_made
189
+ context "with normal characters" do
190
+ let ( :username ) { "username" }
191
+ let ( :password ) { "password" }
192
+
193
+ it "uses the credentials" do
194
+ subject . execute ( pact , options )
195
+ expect ( http_request_with_basic_auth ) . to have_been_made
196
+ end
197
+ end
198
+
199
+ context "with special characters" do
200
+ let ( :username ) { "user_name@site.com" }
201
+ let ( :password ) { "p@$$w0rd!" }
202
+
203
+ it "uses the credentials" do
204
+ subject . execute ( pact , options )
205
+ expect ( http_request_with_basic_auth ) . to have_been_made
206
+ end
195
207
end
196
208
end
197
209
0 commit comments