wash_out 0.9.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/.travis.yml +23 -4
- data/Appraisals +2 -4
- data/Gemfile +1 -1
- data/README.md +38 -0
- data/Rakefile +6 -7
- data/app/helpers/wash_out_helper.rb +49 -18
- data/app/views/{wash_with_soap → wash_out}/document/error.builder +0 -0
- data/app/views/{wash_with_soap → wash_out}/document/response.builder +0 -0
- data/app/views/{wash_with_soap → wash_out}/document/wsdl.builder +13 -13
- data/app/views/{wash_with_soap → wash_out}/rpc/error.builder +0 -0
- data/app/views/{wash_with_soap → wash_out}/rpc/response.builder +0 -0
- data/app/views/{wash_with_soap → wash_out}/rpc/wsdl.builder +14 -14
- data/gemfiles/rails_3.1.3.gemfile +20 -0
- data/gemfiles/rails_3.2.12.gemfile +20 -0
- data/gemfiles/rails_4.0.0.gemfile +19 -0
- data/gemfiles/rails_4.1.0.gemfile +19 -0
- data/gemfiles/rails_4.2.0.gemfile +19 -0
- data/lib/wash_out/dispatcher.rb +28 -18
- data/lib/wash_out/param.rb +14 -2
- data/lib/wash_out/router.rb +5 -5
- data/lib/wash_out/soap.rb +1 -0
- data/lib/wash_out/version.rb +1 -1
- data/lib/wash_out/wsse.rb +3 -3
- data/lib/wash_out.rb +6 -0
- data/spec/dummy/config/environments/test.rb +1 -0
- data/spec/lib/wash_out/dispatcher_spec.rb +15 -15
- data/spec/lib/wash_out/middleware_spec.rb +8 -8
- data/spec/lib/wash_out/param_spec.rb +43 -11
- data/spec/lib/wash_out/type_spec.rb +9 -9
- data/spec/lib/wash_out_spec.rb +111 -96
- data/spec/spec_helper.rb +2 -0
- metadata +14 -9
data/spec/lib/wash_out_spec.rb
CHANGED
@@ -28,19 +28,19 @@ describe WashOut do
|
|
28
28
|
|
29
29
|
describe "Module" do
|
30
30
|
it "includes" do
|
31
|
-
|
31
|
+
expect {
|
32
32
|
mock_controller do
|
33
33
|
# nothing
|
34
34
|
end
|
35
|
-
}.
|
35
|
+
}.not_to raise_exception
|
36
36
|
end
|
37
37
|
|
38
38
|
it "allows definition of a simple action" do
|
39
|
-
|
39
|
+
expect {
|
40
40
|
mock_controller do
|
41
41
|
soap_action "answer", :args => nil, :return => :integer
|
42
42
|
end
|
43
|
-
}.
|
43
|
+
}.not_to raise_exception
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
@@ -68,13 +68,13 @@ describe WashOut do
|
|
68
68
|
|
69
69
|
it "lists operations" do
|
70
70
|
operations = xml[:definitions][:binding][:operation]
|
71
|
-
operations.
|
71
|
+
expect(operations).to be_a_kind_of(Array)
|
72
72
|
|
73
|
-
operations.map{|e| e[:'@name']}.sort.
|
73
|
+
expect(operations.map{|e| e[:'@name']}.sort).to eq ['Result', 'getArea', 'rocky'].sort
|
74
74
|
end
|
75
75
|
|
76
76
|
it "defines complex types" do
|
77
|
-
wsdl.include?('<xsd:complexType name="Circle1">').
|
77
|
+
expect(wsdl.include?('<xsd:complexType name="Circle1">')).to be true
|
78
78
|
end
|
79
79
|
|
80
80
|
it "defines arrays" do
|
@@ -82,8 +82,8 @@ describe WashOut do
|
|
82
82
|
find{|x| x[:'@name'] == 'Center'}[:sequence][:element].
|
83
83
|
find{|x| x[:'@name'] == 'X'}
|
84
84
|
|
85
|
-
x[:'@min_occurs'].
|
86
|
-
x[:'@max_occurs'].
|
85
|
+
expect(x[:'@min_occurs']).to eq "0"
|
86
|
+
expect(x[:'@max_occurs']).to eq "unbounded"
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
@@ -109,7 +109,7 @@ describe WashOut do
|
|
109
109
|
</env:Envelope>
|
110
110
|
XML
|
111
111
|
|
112
|
-
HTTPI.post("http://app/api/action", request).body.
|
112
|
+
expect(HTTPI.post("http://app/api/action", request).body).to eq <<-XML
|
113
113
|
<?xml version="1.0" encoding="UTF-8"?>
|
114
114
|
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="false">
|
115
115
|
<soap:Body>
|
@@ -129,8 +129,8 @@ describe WashOut do
|
|
129
129
|
end
|
130
130
|
end
|
131
131
|
|
132
|
-
savon(:answer)[:answer_response][:value].
|
133
|
-
|
132
|
+
expect(savon(:answer)[:answer_response][:value]).
|
133
|
+
to eq "42"
|
134
134
|
end
|
135
135
|
|
136
136
|
it "accept insufficient parameters" do
|
@@ -141,8 +141,8 @@ describe WashOut do
|
|
141
141
|
end
|
142
142
|
end
|
143
143
|
|
144
|
-
savon(:answer)[:answer_response][:value].
|
145
|
-
|
144
|
+
expect(savon(:answer)[:answer_response][:value]).
|
145
|
+
to eq "42"
|
146
146
|
end
|
147
147
|
|
148
148
|
it "accept empty parameter" do
|
@@ -152,8 +152,8 @@ describe WashOut do
|
|
152
152
|
render :soap => {:a => params[:a]}
|
153
153
|
end
|
154
154
|
end
|
155
|
-
savon(:answer, :a => '')[:answer_response][:a].
|
156
|
-
|
155
|
+
expect(savon(:answer, :a => '')[:answer_response][:a]).
|
156
|
+
to eq({:"@xsi:type"=>"xsd:string"})
|
157
157
|
end
|
158
158
|
|
159
159
|
it "accept one parameter" do
|
@@ -164,8 +164,8 @@ describe WashOut do
|
|
164
164
|
end
|
165
165
|
end
|
166
166
|
|
167
|
-
savon(:check_answer, 42)[:check_answer_response][:value].
|
168
|
-
savon(:check_answer, 13)[:check_answer_response][:value].
|
167
|
+
expect(savon(:check_answer, 42)[:check_answer_response][:value]).to be true
|
168
|
+
expect(savon(:check_answer, 13)[:check_answer_response][:value]).to be false
|
169
169
|
end
|
170
170
|
|
171
171
|
it "accept two parameters" do
|
@@ -176,7 +176,7 @@ describe WashOut do
|
|
176
176
|
end
|
177
177
|
end
|
178
178
|
|
179
|
-
savon(:funky, :a => 42, :b => 'k')[:funky_response][:value].
|
179
|
+
expect(savon(:funky, :a => 42, :b => 'k')[:funky_response][:value]).to eq '420k'
|
180
180
|
end
|
181
181
|
end
|
182
182
|
|
@@ -199,8 +199,8 @@ describe WashOut do
|
|
199
199
|
message = { :circle => { :center => { :x => 3, :y => 4 },
|
200
200
|
:radius => 5 } }
|
201
201
|
|
202
|
-
savon(:get_area, message)[:get_area_response].
|
203
|
-
|
202
|
+
expect(savon(:get_area, message)[:get_area_response]).
|
203
|
+
to eq ({ :area => (Math::PI * 25).to_s, :distance_from_o => (5.0).to_s })
|
204
204
|
end
|
205
205
|
|
206
206
|
it "accept arrays" do
|
@@ -211,7 +211,7 @@ describe WashOut do
|
|
211
211
|
},
|
212
212
|
:return => nil
|
213
213
|
def rumba
|
214
|
-
params.
|
214
|
+
expect(params).to eq({"rumbas" => [1, 2, 3]})
|
215
215
|
render :soap => nil
|
216
216
|
end
|
217
217
|
end
|
@@ -227,7 +227,7 @@ describe WashOut do
|
|
227
227
|
},
|
228
228
|
:return => nil
|
229
229
|
def rumba
|
230
|
-
params.
|
230
|
+
expect(params).to eq({})
|
231
231
|
render :soap => nil
|
232
232
|
end
|
233
233
|
end
|
@@ -242,7 +242,7 @@ describe WashOut do
|
|
242
242
|
},
|
243
243
|
:return => nil
|
244
244
|
def rumba
|
245
|
-
params.
|
245
|
+
expect(params).to eq({"nested" => {}})
|
246
246
|
render :soap => nil
|
247
247
|
end
|
248
248
|
end
|
@@ -260,12 +260,12 @@ describe WashOut do
|
|
260
260
|
},
|
261
261
|
:return => nil
|
262
262
|
def rumba
|
263
|
-
params.
|
263
|
+
expect(params).to eq({
|
264
264
|
"rumbas" => [
|
265
265
|
{"zombies" => 'suck', "puppies" => 'rock'},
|
266
266
|
{"zombies" => 'slow', "puppies" => 'fast'}
|
267
267
|
]
|
268
|
-
}
|
268
|
+
})
|
269
269
|
render :soap => nil
|
270
270
|
end
|
271
271
|
end
|
@@ -292,8 +292,15 @@ describe WashOut do
|
|
292
292
|
end
|
293
293
|
end
|
294
294
|
|
295
|
-
savon(:gogogo)[:gogogo_response].
|
296
|
-
|
295
|
+
expect(savon(:gogogo)[:gogogo_response]).
|
296
|
+
to eq({
|
297
|
+
:zoo=>"zoo",
|
298
|
+
:boo=>{
|
299
|
+
:moo=>"moo",
|
300
|
+
:doo=>"doo",
|
301
|
+
:"@xsi:type"=>"tns:Boo"
|
302
|
+
}
|
303
|
+
})
|
297
304
|
end
|
298
305
|
|
299
306
|
it "respond with arrays" do
|
@@ -306,7 +313,9 @@ describe WashOut do
|
|
306
313
|
end
|
307
314
|
end
|
308
315
|
|
309
|
-
savon(:rumba)[:rumba_response].
|
316
|
+
expect(savon(:rumba)[:rumba_response]).to eq({
|
317
|
+
:value => ["1", "2", "3"]
|
318
|
+
})
|
310
319
|
end
|
311
320
|
|
312
321
|
it "respond with complex structures inside arrays" do
|
@@ -314,55 +323,57 @@ describe WashOut do
|
|
314
323
|
soap_action "rumba",
|
315
324
|
:args => nil,
|
316
325
|
:return => {
|
317
|
-
:rumbas => [{:zombies => :string, :puppies => :string}]
|
326
|
+
:rumbas => [{:@level => :integer, :zombies => :string, :puppies => :string}]
|
318
327
|
}
|
319
328
|
def rumba
|
320
329
|
render :soap =>
|
321
330
|
{:rumbas => [
|
322
|
-
{:zombies => "suck1", :puppies => "rock1" },
|
331
|
+
{:@level => 80, :zombies => "suck1", :puppies => "rock1" },
|
323
332
|
{:zombies => "suck2", :puppies => "rock2" }
|
324
333
|
]
|
325
334
|
}
|
326
335
|
end
|
327
336
|
end
|
328
337
|
|
329
|
-
savon(:rumba)[:rumba_response].
|
338
|
+
expect(savon(:rumba)[:rumba_response]).to eq({
|
330
339
|
:rumbas => [
|
331
|
-
{:zombies => "suck1",:puppies => "rock1", :"@xsi:type"=>"tns:Rumbas"},
|
340
|
+
{:zombies => "suck1",:puppies => "rock1", :"@xsi:type"=>"tns:Rumbas", :@level => "80"},
|
332
341
|
{:zombies => "suck2", :puppies => "rock2", :"@xsi:type"=>"tns:Rumbas" }
|
333
342
|
]
|
334
|
-
}
|
343
|
+
})
|
335
344
|
end
|
336
345
|
|
337
346
|
it "respond with structs in structs in arrays" do
|
338
347
|
mock_controller do
|
339
348
|
soap_action "rumba",
|
340
349
|
:args => nil,
|
341
|
-
:return => [{:rumbas => {:zombies => :integer}}]
|
350
|
+
:return => [{:rumbas => {:@level => :integer, :zombies => :integer}}]
|
342
351
|
|
343
352
|
def rumba
|
344
|
-
render :soap => [{:rumbas => {:zombies => 100000}}, {:rumbas => {:zombies => 2}}]
|
353
|
+
render :soap => [{:rumbas => {:@level => 80, :zombies => 100000}}, {:rumbas => {:@level => 90, :zombies => 2}}]
|
345
354
|
end
|
346
355
|
end
|
347
356
|
|
348
|
-
savon(:rumba)[:rumba_response].
|
357
|
+
expect(savon(:rumba)[:rumba_response]).to eq({
|
349
358
|
:value => [
|
350
359
|
{
|
351
360
|
:rumbas => {
|
352
361
|
:zombies => "100000",
|
353
|
-
:"@xsi:type" => "tns:Rumbas"
|
362
|
+
:"@xsi:type" => "tns:Rumbas",
|
363
|
+
:"@level" => "80"
|
354
364
|
},
|
355
365
|
:"@xsi:type" => "tns:Value"
|
356
366
|
},
|
357
367
|
{
|
358
368
|
:rumbas => {
|
359
369
|
:zombies => "2",
|
360
|
-
:"@xsi:type" => "tns:Rumbas"
|
370
|
+
:"@xsi:type" => "tns:Rumbas",
|
371
|
+
:@level => "90",
|
361
372
|
},
|
362
373
|
:"@xsi:type"=>"tns:Value"
|
363
374
|
}
|
364
375
|
]
|
365
|
-
}
|
376
|
+
})
|
366
377
|
end
|
367
378
|
|
368
379
|
context "with arrays missing" do
|
@@ -375,7 +386,7 @@ describe WashOut do
|
|
375
386
|
end
|
376
387
|
end
|
377
388
|
|
378
|
-
savon(:rocknroll)[:rocknroll_response].
|
389
|
+
expect(savon(:rocknroll)[:rocknroll_response]).to be nil
|
379
390
|
end
|
380
391
|
|
381
392
|
it "respond with complext definition" do
|
@@ -387,7 +398,7 @@ describe WashOut do
|
|
387
398
|
end
|
388
399
|
end
|
389
400
|
|
390
|
-
savon(:rocknroll)[:rocknroll_response].
|
401
|
+
expect(savon(:rocknroll)[:rocknroll_response]).to be nil
|
391
402
|
end
|
392
403
|
|
393
404
|
it "respond with nested simple definition" do
|
@@ -399,8 +410,10 @@ describe WashOut do
|
|
399
410
|
end
|
400
411
|
end
|
401
412
|
|
402
|
-
savon(:rocknroll)[:rocknroll_response][:my_value].
|
403
|
-
|
413
|
+
expect(savon(:rocknroll)[:rocknroll_response][:my_value]).
|
414
|
+
to eq({
|
415
|
+
:"@xsi:type" => "tns:MyValue"
|
416
|
+
})
|
404
417
|
end
|
405
418
|
|
406
419
|
it "handles incomplete array response" do
|
@@ -422,13 +435,13 @@ describe WashOut do
|
|
422
435
|
mock_controller do
|
423
436
|
soap_action "true", :args => :boolean, :return => :nil
|
424
437
|
def true
|
425
|
-
params[:value].
|
438
|
+
expect(params[:value]).to be true
|
426
439
|
render :soap => nil
|
427
440
|
end
|
428
441
|
|
429
442
|
soap_action "false", :args => :boolean, :return => :nil
|
430
443
|
def false
|
431
|
-
params[:value].
|
444
|
+
expect(params[:value]).to be false
|
432
445
|
render :soap => nil
|
433
446
|
end
|
434
447
|
end
|
@@ -443,26 +456,26 @@ describe WashOut do
|
|
443
456
|
mock_controller do
|
444
457
|
soap_action "date", :args => :date, :return => :nil
|
445
458
|
def date
|
446
|
-
params[:value].
|
459
|
+
expect(params[:value]).to eq Date.parse('2000-12-30') unless params[:value].blank?
|
447
460
|
render :soap => nil
|
448
461
|
end
|
449
462
|
end
|
450
463
|
|
451
464
|
savon(:date, :value => '2000-12-30')
|
452
|
-
|
465
|
+
expect { savon(:date) }.not_to raise_exception
|
453
466
|
end
|
454
467
|
|
455
468
|
it "recognize base64Binary" do
|
456
469
|
mock_controller do
|
457
470
|
soap_action "base64", :args => :base64Binary, :return => :nil
|
458
471
|
def base64
|
459
|
-
params[:value].
|
472
|
+
expect(params[:value]).to eq('test') unless params[:value].blank?
|
460
473
|
render :soap => nil
|
461
474
|
end
|
462
475
|
end
|
463
476
|
|
464
477
|
savon(:base64, :value => Base64.encode64('test'))
|
465
|
-
|
478
|
+
expect { savon(:base64) }.not_to raise_exception
|
466
479
|
end
|
467
480
|
end
|
468
481
|
|
@@ -477,9 +490,9 @@ describe WashOut do
|
|
477
490
|
end
|
478
491
|
end
|
479
492
|
|
480
|
-
|
493
|
+
expect {
|
481
494
|
savon(:duty, :bad => 42, :good => nil)
|
482
|
-
}.
|
495
|
+
}.to raise_exception(Savon::SOAPFault)
|
483
496
|
end
|
484
497
|
|
485
498
|
it "raise for date in incorrect format" do
|
@@ -489,9 +502,9 @@ describe WashOut do
|
|
489
502
|
render :soap => nil
|
490
503
|
end
|
491
504
|
end
|
492
|
-
|
505
|
+
expect {
|
493
506
|
savon(:date, :value => 'incorrect format')
|
494
|
-
}.
|
507
|
+
}.to raise_exception(Savon::SOAPFault)
|
495
508
|
end
|
496
509
|
|
497
510
|
it "raise to report SOAP errors" do
|
@@ -503,8 +516,8 @@ describe WashOut do
|
|
503
516
|
end
|
504
517
|
end
|
505
518
|
|
506
|
-
|
507
|
-
|
519
|
+
expect { savon(:error, :need_error => false) }.not_to raise_exception
|
520
|
+
expect { savon(:error, :need_error => true) }.to raise_exception(Savon::SOAPFault)
|
508
521
|
end
|
509
522
|
|
510
523
|
it "misses basic exceptions" do
|
@@ -516,8 +529,8 @@ describe WashOut do
|
|
516
529
|
end
|
517
530
|
end
|
518
531
|
|
519
|
-
|
520
|
-
|
532
|
+
expect { savon(:error, :need_error => false) }.not_to raise_exception
|
533
|
+
expect { savon(:error, :need_error => true) }.to raise_exception(Exception)
|
521
534
|
end
|
522
535
|
|
523
536
|
it "raise for manual throws" do
|
@@ -528,7 +541,7 @@ describe WashOut do
|
|
528
541
|
end
|
529
542
|
end
|
530
543
|
|
531
|
-
|
544
|
+
expect { savon(:error) }.to raise_exception(Savon::SOAPFault)
|
532
545
|
end
|
533
546
|
|
534
547
|
it "raise when response structure mismatches" do
|
@@ -561,12 +574,12 @@ describe WashOut do
|
|
561
574
|
end
|
562
575
|
end
|
563
576
|
|
564
|
-
|
577
|
+
expect { savon(:bad) }.to raise_exception(
|
565
578
|
WashOut::Dispatcher::ProgrammerError,
|
566
579
|
/SOAP response .*wyldness.*Array.*Hash.*stallion/
|
567
580
|
)
|
568
581
|
|
569
|
-
|
582
|
+
expect { savon(:bad2) }.to raise_exception(
|
570
583
|
WashOut::Dispatcher::ProgrammerError,
|
571
584
|
/SOAP response .*oops.*String.*telephone_booths.*Array/
|
572
585
|
)
|
@@ -574,11 +587,14 @@ describe WashOut do
|
|
574
587
|
end
|
575
588
|
|
576
589
|
context "deprecates" do
|
577
|
-
|
590
|
+
# This test uses deprecated rspec expectations
|
591
|
+
# and it's not clear how to rewrite it.
|
592
|
+
xit "old syntax" do
|
578
593
|
# save rspec context check
|
579
594
|
raise_runtime_exception = raise_exception(RuntimeError)
|
580
595
|
|
581
596
|
mock_controller do
|
597
|
+
|
582
598
|
lambda {
|
583
599
|
soap_action "rumba",
|
584
600
|
:args => :integer,
|
@@ -601,8 +617,7 @@ describe WashOut do
|
|
601
617
|
end
|
602
618
|
end
|
603
619
|
|
604
|
-
savon(name.underscore.to_sym)["#{name.underscore}_response".to_sym][:value].
|
605
|
-
should == "forty two"
|
620
|
+
expect(savon(name.underscore.to_sym)["#{name.underscore}_response".to_sym][:value]).to eq "forty two"
|
606
621
|
end
|
607
622
|
|
608
623
|
it "respects :response_tag option" do
|
@@ -613,14 +628,14 @@ describe WashOut do
|
|
613
628
|
end
|
614
629
|
end
|
615
630
|
|
616
|
-
savon(:specific).
|
631
|
+
expect(savon(:specific)).to eq({:test => {:value=>"test"}})
|
617
632
|
end
|
618
633
|
|
619
634
|
it "handles snakecase option properly" do
|
620
635
|
mock_controller(snakecase_input: false, camelize_wsdl: false) do
|
621
636
|
soap_action "rocknroll", :args => {:ZOMG => :string}, :return => nil
|
622
637
|
def rocknroll
|
623
|
-
params["ZOMG"].
|
638
|
+
expect(params["ZOMG"]).to eq "yam!"
|
624
639
|
render :soap => nil
|
625
640
|
end
|
626
641
|
end
|
@@ -636,8 +651,8 @@ describe WashOut do
|
|
636
651
|
mock_controller(wsse_username: "gorilla", wsse_password: "secret") do
|
637
652
|
soap_action "checkToken", :args => :integer, :return => nil, :to => 'check_token'
|
638
653
|
def check_token
|
639
|
-
request.env['WSSE_TOKEN']['username'].
|
640
|
-
request.env['WSSE_TOKEN']['password'].
|
654
|
+
expect(request.env['WSSE_TOKEN']['username']).to eq "gorilla"
|
655
|
+
expect(request.env['WSSE_TOKEN']['password']).to eq "secret"
|
641
656
|
render :soap => nil
|
642
657
|
end
|
643
658
|
end
|
@@ -656,20 +671,20 @@ describe WashOut do
|
|
656
671
|
end
|
657
672
|
|
658
673
|
# correct auth
|
659
|
-
|
660
|
-
|
674
|
+
expect { savon(:check_auth, 42){ wsse_auth "gorilla", "secret" } }.
|
675
|
+
not_to raise_exception
|
661
676
|
|
662
677
|
# wrong user
|
663
|
-
|
664
|
-
|
678
|
+
expect { savon(:check_auth, 42){ wsse_auth "chimpanzee", "secret" } }.
|
679
|
+
to raise_exception(Savon::SOAPFault)
|
665
680
|
|
666
681
|
# wrong pass
|
667
|
-
|
668
|
-
|
682
|
+
expect { savon(:check_auth, 42){ wsse_auth "gorilla", "nicetry" } }.
|
683
|
+
to raise_exception(Savon::SOAPFault)
|
669
684
|
|
670
685
|
# no auth
|
671
|
-
|
672
|
-
|
686
|
+
expect { savon(:check_auth, 42) }.
|
687
|
+
to raise_exception(Savon::SOAPFault)
|
673
688
|
end
|
674
689
|
|
675
690
|
it "handles PasswordDigest auth" do
|
@@ -681,24 +696,24 @@ describe WashOut do
|
|
681
696
|
end
|
682
697
|
|
683
698
|
# correct auth
|
684
|
-
|
685
|
-
|
699
|
+
expect { savon(:check_auth, 42){ wsse_auth "gorilla", "secret" } }.
|
700
|
+
not_to raise_exception
|
686
701
|
|
687
702
|
# correct digest auth
|
688
|
-
|
689
|
-
|
703
|
+
expect { savon(:check_auth, 42){ wsse_auth "gorilla", "secret", :digest } }.
|
704
|
+
not_to raise_exception
|
690
705
|
|
691
706
|
# wrong user
|
692
|
-
|
693
|
-
|
707
|
+
expect { savon(:check_auth, 42){ wsse_auth "chimpanzee", "secret", :digest } }.
|
708
|
+
to raise_exception(Savon::SOAPFault)
|
694
709
|
|
695
710
|
# wrong pass
|
696
|
-
|
697
|
-
|
711
|
+
expect { savon(:check_auth, 42){ wsse_auth "gorilla", "nicetry", :digest } }.
|
712
|
+
to raise_exception(Savon::SOAPFault)
|
698
713
|
|
699
714
|
# no auth
|
700
|
-
|
701
|
-
|
715
|
+
expect { savon(:check_auth, 42) }.
|
716
|
+
to raise_exception(Savon::SOAPFault)
|
702
717
|
end
|
703
718
|
|
704
719
|
it "handles auth callback" do
|
@@ -714,24 +729,24 @@ describe WashOut do
|
|
714
729
|
end
|
715
730
|
|
716
731
|
# correct auth
|
717
|
-
|
718
|
-
|
732
|
+
expect { savon(:check_auth, 42){ wsse_auth "gorilla", "secret" } }.
|
733
|
+
not_to raise_exception
|
719
734
|
|
720
735
|
# correct digest auth
|
721
|
-
|
722
|
-
|
736
|
+
expect { savon(:check_auth, 42){ wsse_auth "gorilla", "secret", :digest } }.
|
737
|
+
to raise_exception(Savon::SOAPFault)
|
723
738
|
|
724
739
|
# wrong user
|
725
|
-
|
726
|
-
|
740
|
+
expect { savon(:check_auth, 42){ wsse_auth "chimpanzee", "secret", :digest } }.
|
741
|
+
to raise_exception(Savon::SOAPFault)
|
727
742
|
|
728
743
|
# wrong pass
|
729
|
-
|
730
|
-
|
744
|
+
expect { savon(:check_auth, 42){ wsse_auth "gorilla", "nicetry", :digest } }.
|
745
|
+
to raise_exception(Savon::SOAPFault)
|
731
746
|
|
732
747
|
# no auth
|
733
|
-
|
734
|
-
|
748
|
+
expect { savon(:check_auth, 42) }.
|
749
|
+
to raise_exception(Savon::SOAPFault)
|
735
750
|
end
|
736
751
|
|
737
752
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -56,6 +56,8 @@ end
|
|
56
56
|
def mock_controller(options = {}, &block)
|
57
57
|
Object.send :remove_const, :ApiController if defined?(ApiController)
|
58
58
|
Object.send :const_set, :ApiController, Class.new(ApplicationController) {
|
59
|
+
include RSpec::Matchers
|
60
|
+
|
59
61
|
soap_service options.reverse_merge({
|
60
62
|
snakecase_input: true,
|
61
63
|
camelize_wsdl: true,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wash_out
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boris Staal
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-02-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nori
|
@@ -42,12 +42,17 @@ files:
|
|
42
42
|
- README.md
|
43
43
|
- Rakefile
|
44
44
|
- app/helpers/wash_out_helper.rb
|
45
|
-
- app/views/
|
46
|
-
- app/views/
|
47
|
-
- app/views/
|
48
|
-
- app/views/
|
49
|
-
- app/views/
|
50
|
-
- app/views/
|
45
|
+
- app/views/wash_out/document/error.builder
|
46
|
+
- app/views/wash_out/document/response.builder
|
47
|
+
- app/views/wash_out/document/wsdl.builder
|
48
|
+
- app/views/wash_out/rpc/error.builder
|
49
|
+
- app/views/wash_out/rpc/response.builder
|
50
|
+
- app/views/wash_out/rpc/wsdl.builder
|
51
|
+
- gemfiles/rails_3.1.3.gemfile
|
52
|
+
- gemfiles/rails_3.2.12.gemfile
|
53
|
+
- gemfiles/rails_4.0.0.gemfile
|
54
|
+
- gemfiles/rails_4.1.0.gemfile
|
55
|
+
- gemfiles/rails_4.2.0.gemfile
|
51
56
|
- init.rb
|
52
57
|
- lib/wash_out.rb
|
53
58
|
- lib/wash_out/configurable.rb
|
@@ -114,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
119
|
version: '0'
|
115
120
|
requirements: []
|
116
121
|
rubyforge_project:
|
117
|
-
rubygems_version: 2.2.
|
122
|
+
rubygems_version: 2.2.5
|
118
123
|
signing_key:
|
119
124
|
specification_version: 4
|
120
125
|
summary: Dead simple Rails 3 SOAP server library
|