defra_ruby_mocks 2.2.0 → 2.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/spec/examples.txt CHANGED
@@ -1,114 +1,121 @@
1
1
  example_id | status | run_time |
2
2
  ------------------------------------------------------------------- | ------ | --------------- |
3
- ./spec/defra_ruby_mocks_spec.rb[1:1:1] | passed | 0.00213 seconds |
4
- ./spec/defra_ruby_mocks_spec.rb[1:2:1:1] | passed | 0.00077 seconds |
5
- ./spec/defra_ruby_mocks_spec.rb[1:2:2:1] | passed | 0.00014 seconds |
6
- ./spec/lib/configuration_spec.rb[1:1:1:1] | passed | 0.00015 seconds |
7
- ./spec/lib/configuration_spec.rb[1:1:2:1] | passed | 0.00012 seconds |
8
- ./spec/lib/configuration_spec.rb[1:1:3:1] | passed | 0.00094 seconds |
9
- ./spec/lib/configuration_spec.rb[1:1:4:1] | passed | 0.00012 seconds |
10
- ./spec/lib/configuration_spec.rb[1:2:1:1] | passed | 0.0001 seconds |
11
- ./spec/lib/configuration_spec.rb[1:2:2:1] | passed | 0.00013 seconds |
3
+ ./spec/defra_ruby_mocks_spec.rb[1:1:1] | passed | 0.00217 seconds |
4
+ ./spec/defra_ruby_mocks_spec.rb[1:2:1:1] | passed | 0.00014 seconds |
5
+ ./spec/defra_ruby_mocks_spec.rb[1:2:2:1] | passed | 0.00011 seconds |
6
+ ./spec/lib/configuration_spec.rb[1:1:1:1] | passed | 0.00008 seconds |
7
+ ./spec/lib/configuration_spec.rb[1:1:2:1] | passed | 0.00009 seconds |
8
+ ./spec/lib/configuration_spec.rb[1:1:3:1] | passed | 0.0009 seconds |
9
+ ./spec/lib/configuration_spec.rb[1:1:4:1] | passed | 0.00008 seconds |
10
+ ./spec/lib/configuration_spec.rb[1:2:1:1] | passed | 0.00008 seconds |
11
+ ./spec/lib/configuration_spec.rb[1:2:2:1] | passed | 0.00008 seconds |
12
12
  ./spec/lib/configuration_spec.rb[1:2:3:1] | passed | 0.0001 seconds |
13
- ./spec/lib/configuration_spec.rb[1:2:4:1] | passed | 0.00012 seconds |
14
- ./spec/requests/company_spec.rb[1:1:1:1] | passed | 0.00327 seconds |
15
- ./spec/requests/company_spec.rb[1:1:2:1] | passed | 0.00356 seconds |
16
- ./spec/requests/company_spec.rb[1:1:3:1:1] | passed | 0.17753 seconds |
17
- ./spec/requests/company_spec.rb[1:1:3:2:1] | passed | 0.00775 seconds |
18
- ./spec/requests/company_spec.rb[1:2:1] | passed | 0.00511 seconds |
19
- ./spec/requests/officers_spec.rb[1:1:1] | passed | 0.00648 seconds |
20
- ./spec/requests/officers_spec.rb[1:2:1] | passed | 0.01114 seconds |
21
- ./spec/requests/worldpay_spec.rb[1:1:1:1:1:1] | passed | 0.00492 seconds |
22
- ./spec/requests/worldpay_spec.rb[1:1:1:1:2:1] | passed | 0.0048 seconds |
23
- ./spec/requests/worldpay_spec.rb[1:1:1:2:1:1] | passed | 0.00696 seconds |
24
- ./spec/requests/worldpay_spec.rb[1:1:2:1:1:1] | passed | 0.00632 seconds |
25
- ./spec/requests/worldpay_spec.rb[1:1:2:1:2:1] | passed | 0.00646 seconds |
26
- ./spec/requests/worldpay_spec.rb[1:1:2:2:1:1] | passed | 0.00395 seconds |
27
- ./spec/requests/worldpay_spec.rb[1:2:1:1] | passed | 0.00195 seconds |
28
- ./spec/requests/worldpay_spec.rb[1:2:2:1] | passed | 0.00538 seconds |
29
- ./spec/services/companies_house_service_spec.rb[1:1:1:1] | passed | 0.00015 seconds |
30
- ./spec/services/companies_house_service_spec.rb[1:1:2:1:1] | passed | 0.00011 seconds |
31
- ./spec/services/companies_house_service_spec.rb[1:1:2:1:2] | passed | 0.00012 seconds |
32
- ./spec/services/companies_house_service_spec.rb[1:1:2:2:1] | passed | 0.00012 seconds |
33
- ./spec/services/companies_house_service_spec.rb[1:1:2:2:2] | passed | 0.00011 seconds |
34
- ./spec/services/companies_house_service_spec.rb[1:1:2:3:1] | passed | 0.00011 seconds |
35
- ./spec/services/companies_house_service_spec.rb[1:1:2:3:2] | passed | 0.00013 seconds |
36
- ./spec/services/companies_house_service_spec.rb[1:1:2:4:1] | passed | 0.00012 seconds |
37
- ./spec/services/companies_house_service_spec.rb[1:1:2:4:2] | passed | 0.00012 seconds |
38
- ./spec/services/companies_house_service_spec.rb[1:1:2:5:1] | passed | 0.00011 seconds |
39
- ./spec/services/companies_house_service_spec.rb[1:1:2:5:2] | passed | 0.00012 seconds |
40
- ./spec/services/companies_house_service_spec.rb[1:1:2:6:1] | passed | 0.00015 seconds |
41
- ./spec/services/companies_house_service_spec.rb[1:1:2:6:2] | passed | 0.00013 seconds |
42
- ./spec/services/companies_house_service_spec.rb[1:1:2:7:1] | passed | 0.00012 seconds |
43
- ./spec/services/companies_house_service_spec.rb[1:1:2:7:2] | passed | 0.00012 seconds |
44
- ./spec/services/companies_house_service_spec.rb[1:1:2:8:1] | passed | 0.00015 seconds |
45
- ./spec/services/companies_house_service_spec.rb[1:1:2:8:2] | passed | 0.00015 seconds |
46
- ./spec/services/companies_house_service_spec.rb[1:1:2:9:1] | passed | 0.00013 seconds |
47
- ./spec/services/companies_house_service_spec.rb[1:1:2:9:2] | passed | 0.0001 seconds |
48
- ./spec/services/companies_house_service_spec.rb[1:1:3:1] | passed | 0.00011 seconds |
49
- ./spec/services/companies_house_service_spec.rb[1:1:3:2] | passed | 0.00011 seconds |
50
- ./spec/services/companies_house_service_spec.rb[1:1:3:3] | passed | 0.00013 seconds |
51
- ./spec/services/companies_house_service_spec.rb[1:1:3:4] | passed | 0.00018 seconds |
52
- ./spec/services/companies_house_service_spec.rb[1:1:4:1:1] | passed | 0.00012 seconds |
53
- ./spec/services/companies_house_service_spec.rb[1:1:4:2:1] | passed | 0.00019 seconds |
54
- ./spec/services/worldpay_payment_service_spec.rb[1:1:1:1] | passed | 0.0002 seconds |
55
- ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:1] | passed | 0.00041 seconds |
56
- ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:2] | passed | 0.00043 seconds |
57
- ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:3] | passed | 0.00032 seconds |
13
+ ./spec/lib/configuration_spec.rb[1:2:4:1] | passed | 0.00008 seconds |
14
+ ./spec/requests/company_spec.rb[1:1:1:1] | passed | 0.00845 seconds |
15
+ ./spec/requests/company_spec.rb[1:1:2:1] | passed | 0.00352 seconds |
16
+ ./spec/requests/company_spec.rb[1:1:3:1:1] | passed | 0.00231 seconds |
17
+ ./spec/requests/company_spec.rb[1:1:3:2:1] | passed | 0.00258 seconds |
18
+ ./spec/requests/company_spec.rb[1:2:1] | passed | 0.00106 seconds |
19
+ ./spec/requests/govpay_spec.rb[1:1:1:1:1] | passed | 0.00344 seconds |
20
+ ./spec/requests/govpay_spec.rb[1:1:1:2:1] | passed | 0.00259 seconds |
21
+ ./spec/requests/govpay_spec.rb[1:1:2:1:1] | passed | 0.00309 seconds |
22
+ ./spec/requests/govpay_spec.rb[1:1:2:2:1] | passed | 0.00426 seconds |
23
+ ./spec/requests/govpay_spec.rb[1:2:1:1] | passed | 0.00093 seconds |
24
+ ./spec/requests/govpay_spec.rb[1:2:2:1] | passed | 0.00425 seconds |
25
+ ./spec/requests/govpay_spec.rb[1:2:3:1] | passed | 0.00353 seconds |
26
+ ./spec/requests/officers_spec.rb[1:1:1] | passed | 0.0031 seconds |
27
+ ./spec/requests/officers_spec.rb[1:2:1] | passed | 0.00114 seconds |
28
+ ./spec/requests/worldpay_spec.rb[1:1:1:1:1:1] | passed | 0.00355 seconds |
29
+ ./spec/requests/worldpay_spec.rb[1:1:1:1:2:1] | passed | 0.0026 seconds |
30
+ ./spec/requests/worldpay_spec.rb[1:1:1:2:1:1] | passed | 0.04013 seconds |
31
+ ./spec/requests/worldpay_spec.rb[1:1:2:1:1:1] | passed | 0.00372 seconds |
32
+ ./spec/requests/worldpay_spec.rb[1:1:2:1:2:1] | passed | 0.00412 seconds |
33
+ ./spec/requests/worldpay_spec.rb[1:1:2:2:1:1] | passed | 0.00572 seconds |
34
+ ./spec/requests/worldpay_spec.rb[1:2:1:1] | passed | 0.00114 seconds |
35
+ ./spec/requests/worldpay_spec.rb[1:2:2:1] | passed | 0.00129 seconds |
36
+ ./spec/services/companies_house_service_spec.rb[1:1:1:1] | passed | 0.00011 seconds |
37
+ ./spec/services/companies_house_service_spec.rb[1:1:2:1:1] | passed | 0.00008 seconds |
38
+ ./spec/services/companies_house_service_spec.rb[1:1:2:1:2] | passed | 0.00009 seconds |
39
+ ./spec/services/companies_house_service_spec.rb[1:1:2:2:1] | passed | 0.00008 seconds |
40
+ ./spec/services/companies_house_service_spec.rb[1:1:2:2:2] | passed | 0.00014 seconds |
41
+ ./spec/services/companies_house_service_spec.rb[1:1:2:3:1] | passed | 0.00008 seconds |
42
+ ./spec/services/companies_house_service_spec.rb[1:1:2:3:2] | passed | 0.00008 seconds |
43
+ ./spec/services/companies_house_service_spec.rb[1:1:2:4:1] | passed | 0.00009 seconds |
44
+ ./spec/services/companies_house_service_spec.rb[1:1:2:4:2] | passed | 0.00008 seconds |
45
+ ./spec/services/companies_house_service_spec.rb[1:1:2:5:1] | passed | 0.00008 seconds |
46
+ ./spec/services/companies_house_service_spec.rb[1:1:2:5:2] | passed | 0.00008 seconds |
47
+ ./spec/services/companies_house_service_spec.rb[1:1:2:6:1] | passed | 0.00008 seconds |
48
+ ./spec/services/companies_house_service_spec.rb[1:1:2:6:2] | passed | 0.00009 seconds |
49
+ ./spec/services/companies_house_service_spec.rb[1:1:2:7:1] | passed | 0.00009 seconds |
50
+ ./spec/services/companies_house_service_spec.rb[1:1:2:7:2] | passed | 0.00008 seconds |
51
+ ./spec/services/companies_house_service_spec.rb[1:1:2:8:1] | passed | 0.00009 seconds |
52
+ ./spec/services/companies_house_service_spec.rb[1:1:2:8:2] | passed | 0.00008 seconds |
53
+ ./spec/services/companies_house_service_spec.rb[1:1:2:9:1] | passed | 0.00008 seconds |
54
+ ./spec/services/companies_house_service_spec.rb[1:1:2:9:2] | passed | 0.00008 seconds |
55
+ ./spec/services/companies_house_service_spec.rb[1:1:3:1] | passed | 0.00008 seconds |
56
+ ./spec/services/companies_house_service_spec.rb[1:1:3:2] | passed | 0.0001 seconds |
57
+ ./spec/services/companies_house_service_spec.rb[1:1:3:3] | passed | 0.00009 seconds |
58
+ ./spec/services/companies_house_service_spec.rb[1:1:3:4] | passed | 0.00007 seconds |
59
+ ./spec/services/companies_house_service_spec.rb[1:1:4:1:1] | passed | 0.0001 seconds |
60
+ ./spec/services/companies_house_service_spec.rb[1:1:4:2:1] | passed | 0.00012 seconds |
61
+ ./spec/services/worldpay_payment_service_spec.rb[1:1:1:1] | passed | 0.00011 seconds |
62
+ ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:1] | passed | 0.0003 seconds |
63
+ ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:2] | passed | 0.00033 seconds |
64
+ ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:3] | passed | 0.00028 seconds |
58
65
  ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:4] | passed | 0.00033 seconds |
59
- ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:5:1] | passed | 0.00028 seconds |
60
- ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:5:2] | passed | 0.00029 seconds |
61
- ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:5:3] | passed | 0.00043 seconds |
66
+ ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:5:1] | passed | 0.00038 seconds |
67
+ ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:5:2] | passed | 0.00035 seconds |
68
+ ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:5:3] | passed | 0.00035 seconds |
62
69
  ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:6:1] | passed | 0.00033 seconds |
63
- ./spec/services/worldpay_payment_service_spec.rb[1:1:3:1] | passed | 0.00046 seconds |
64
- ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:1] | passed | 0.00034 seconds |
65
- ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:2] | passed | 0.00034 seconds |
66
- ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:3] | passed | 0.00034 seconds |
67
- ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:4] | passed | 0.00031 seconds |
68
- ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:5] | passed | 0.00038 seconds |
69
- ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:6] | passed | 0.00034 seconds |
70
- ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:7] | passed | 0.00052 seconds |
71
- ./spec/services/worldpay_refund_service_spec.rb[1:1:2:1] | passed | 0.00033 seconds |
72
- ./spec/services/worldpay_request_handler_service_spec.rb[1:1:1:1:1] | passed | 0.00976 seconds |
73
- ./spec/services/worldpay_request_handler_service_spec.rb[1:1:1:1:2] | passed | 0.00109 seconds |
74
- ./spec/services/worldpay_request_handler_service_spec.rb[1:1:1:2:1] | passed | 0.00085 seconds |
75
- ./spec/services/worldpay_request_handler_service_spec.rb[1:1:1:2:2] | passed | 0.00077 seconds |
76
- ./spec/services/worldpay_request_handler_service_spec.rb[1:1:1:3:1] | passed | 0.00066 seconds |
77
- ./spec/services/worldpay_resource_service_spec.rb[1:1:1:1] | passed | 0.0016 seconds |
78
- ./spec/services/worldpay_resource_service_spec.rb[1:1:1:2] | passed | 0.00082 seconds |
79
- ./spec/services/worldpay_resource_service_spec.rb[1:1:1:3] | passed | 0.00088 seconds |
80
- ./spec/services/worldpay_resource_service_spec.rb[1:1:1:4] | passed | 0.00072 seconds |
81
- ./spec/services/worldpay_resource_service_spec.rb[1:1:2:1] | passed | 0.00279 seconds |
82
- ./spec/services/worldpay_resource_service_spec.rb[1:1:2:2] | passed | 0.0011 seconds |
83
- ./spec/services/worldpay_resource_service_spec.rb[1:1:2:3] | passed | 0.00162 seconds |
84
- ./spec/services/worldpay_resource_service_spec.rb[1:1:2:4] | passed | 0.00111 seconds |
85
- ./spec/services/worldpay_resource_service_spec.rb[1:1:3:1] | passed | 0.00188 seconds |
86
- ./spec/services/worldpay_resource_service_spec.rb[1:1:4:1] | passed | 0.00076 seconds |
87
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:1] | passed | 0.00085 seconds |
88
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:2] | passed | 0.00092 seconds |
89
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:3:1] | passed | 0.00088 seconds |
90
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:3:2] | passed | 0.00073 seconds |
91
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:4:1] | passed | 0.00065 seconds |
92
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:4:2] | passed | 0.00074 seconds |
93
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:5:1] | passed | 0.00065 seconds |
94
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:5:2] | passed | 0.00065 seconds |
95
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:6:1] | passed | 0.00084 seconds |
96
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:6:2] | passed | 0.0011 seconds |
97
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:7:1] | passed | 0.0008 seconds |
98
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:7:2] | passed | 0.00085 seconds |
99
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:8:1] | passed | 0.00072 seconds |
100
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:8:2] | passed | 0.0011 seconds |
101
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:1] | passed | 0.00062 seconds |
102
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:2] | passed | 0.00074 seconds |
103
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:3:1] | passed | 0.00063 seconds |
104
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:3:2] | passed | 0.00068 seconds |
105
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:4:1] | passed | 0.00066 seconds |
106
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:4:2] | passed | 0.00073 seconds |
107
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:5:1] | passed | 0.00081 seconds |
108
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:5:2] | passed | 0.00072 seconds |
109
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:6:1] | passed | 0.0008 seconds |
110
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:6:2] | passed | 0.00088 seconds |
111
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:7:1] | passed | 0.00072 seconds |
112
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:7:2] | passed | 0.0009 seconds |
113
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:8:1] | passed | 0.00093 seconds |
114
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:8:2] | passed | 0.00122 seconds |
70
+ ./spec/services/worldpay_payment_service_spec.rb[1:1:3:1] | passed | 0.00032 seconds |
71
+ ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:1] | passed | 0.00121 seconds |
72
+ ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:2] | passed | 0.0003 seconds |
73
+ ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:3] | passed | 0.00126 seconds |
74
+ ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:4] | passed | 0.00045 seconds |
75
+ ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:5] | passed | 0.00039 seconds |
76
+ ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:6] | passed | 0.00038 seconds |
77
+ ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:7] | passed | 0.00031 seconds |
78
+ ./spec/services/worldpay_refund_service_spec.rb[1:1:2:1] | passed | 0.11633 seconds |
79
+ ./spec/services/worldpay_request_handler_service_spec.rb[1:1:1:1:1] | passed | 0.00098 seconds |
80
+ ./spec/services/worldpay_request_handler_service_spec.rb[1:1:1:1:2] | passed | 0.00079 seconds |
81
+ ./spec/services/worldpay_request_handler_service_spec.rb[1:1:1:2:1] | passed | 0.00057 seconds |
82
+ ./spec/services/worldpay_request_handler_service_spec.rb[1:1:1:2:2] | passed | 0.00049 seconds |
83
+ ./spec/services/worldpay_request_handler_service_spec.rb[1:1:1:3:1] | passed | 0.00051 seconds |
84
+ ./spec/services/worldpay_resource_service_spec.rb[1:1:1:1] | passed | 0.00069 seconds |
85
+ ./spec/services/worldpay_resource_service_spec.rb[1:1:1:2] | passed | 0.00065 seconds |
86
+ ./spec/services/worldpay_resource_service_spec.rb[1:1:1:3] | passed | 0.00046 seconds |
87
+ ./spec/services/worldpay_resource_service_spec.rb[1:1:1:4] | passed | 0.00047 seconds |
88
+ ./spec/services/worldpay_resource_service_spec.rb[1:1:2:1] | passed | 0.00063 seconds |
89
+ ./spec/services/worldpay_resource_service_spec.rb[1:1:2:2] | passed | 0.00055 seconds |
90
+ ./spec/services/worldpay_resource_service_spec.rb[1:1:2:3] | passed | 0.00054 seconds |
91
+ ./spec/services/worldpay_resource_service_spec.rb[1:1:2:4] | passed | 0.00051 seconds |
92
+ ./spec/services/worldpay_resource_service_spec.rb[1:1:3:1] | passed | 0.00176 seconds |
93
+ ./spec/services/worldpay_resource_service_spec.rb[1:1:4:1] | passed | 0.00921 seconds |
94
+ ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:1] | passed | 0.00048 seconds |
95
+ ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:2] | passed | 0.00064 seconds |
96
+ ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:3:1] | passed | 0.00046 seconds |
97
+ ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:3:2] | passed | 0.00047 seconds |
98
+ ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:4:1] | passed | 0.00044 seconds |
99
+ ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:4:2] | passed | 0.0005 seconds |
100
+ ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:5:1] | passed | 0.00047 seconds |
101
+ ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:5:2] | passed | 0.00041 seconds |
102
+ ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:6:1] | passed | 0.00044 seconds |
103
+ ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:6:2] | passed | 0.00047 seconds |
104
+ ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:7:1] | passed | 0.00046 seconds |
105
+ ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:7:2] | passed | 0.00047 seconds |
106
+ ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:8:1] | passed | 0.00046 seconds |
107
+ ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:8:2] | passed | 0.00048 seconds |
108
+ ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:1] | passed | 0.00048 seconds |
109
+ ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:2] | passed | 0.00048 seconds |
110
+ ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:3:1] | passed | 0.00047 seconds |
111
+ ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:3:2] | passed | 0.00048 seconds |
112
+ ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:4:1] | passed | 0.00047 seconds |
113
+ ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:4:2] | passed | 0.00045 seconds |
114
+ ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:5:1] | passed | 0.00048 seconds |
115
+ ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:5:2] | passed | 0.00042 seconds |
116
+ ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:6:1] | passed | 0.00045 seconds |
117
+ ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:6:2] | passed | 0.00045 seconds |
118
+ ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:7:1] | passed | 0.00044 seconds |
119
+ ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:7:2] | passed | 0.00047 seconds |
120
+ ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:8:1] | passed | 0.00049 seconds |
121
+ ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:8:2] | passed | 0.00048 seconds |
@@ -0,0 +1,107 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails_helper"
4
+
5
+ module DefraRubyMocks
6
+ RSpec.describe "Govpay", type: :request do
7
+ after(:all) { Helpers::Configuration.reset_for_tests }
8
+
9
+ context "when mocks are enabled" do
10
+ before(:each) do
11
+ Helpers::Configuration.prep_for_tests
12
+ DefraRubyMocks.configure do |config|
13
+ config.govpay_domain = "http://localhost:3000/defra_ruby_mocks"
14
+ end
15
+
16
+ end
17
+
18
+ context "#create_payment" do
19
+ let(:path) { "/defra_ruby_mocks/govpay/v1/payments" }
20
+ # Use an example from the Govpay documentation
21
+ let(:payment_request) do
22
+ {
23
+ amount: 14_500,
24
+ reference: "12345",
25
+ description: "Pay your council tax",
26
+ return_url: "https://your.service.gov.uk/completed"
27
+ }
28
+ end
29
+
30
+ context "when the request is valid" do
31
+
32
+ it "returns a valid success response" do
33
+ post path, params: payment_request.as_json
34
+
35
+ expect(response.media_type).to eq("application/json")
36
+ expect(response.code).to eq("200")
37
+ response_json = JSON.parse(response.body)
38
+ expect(response_json["reference"]).to eq payment_request[:reference]
39
+ expect(response_json["amount"]).to eq payment_request[:amount]
40
+ expect(response_json["description"]).to eq payment_request[:description]
41
+ expect(response_json["_links"]["next_url"]["href"]).to eq payment_request[:return_url]
42
+ end
43
+ end
44
+
45
+ context "when the request is missing a mandatory parameter" do
46
+ before { payment_request[:amount] = nil }
47
+
48
+ it "returns a HTTP 500 responseß" do
49
+ post path, params: payment_request.as_json
50
+
51
+ expect(response.code).to eq "500"
52
+ end
53
+ end
54
+ end
55
+
56
+ describe "#payment_details" do
57
+ let(:path) { "/defra_ruby_mocks/govpay/v1/payments/#{payment_id}" }
58
+ context "when the payment id is valid" do
59
+ let(:payment_id) { "12345678901234567890123456" }
60
+ it "returns a valid success response" do
61
+ get path
62
+
63
+ expect(response.code).to eq "200"
64
+ end
65
+ end
66
+
67
+ context "when the payment id is not valid" do
68
+ let(:payment_id) { "0" }
69
+ it "returns a 422 response" do
70
+ get path
71
+
72
+ expect(response.code).to eq "422"
73
+ end
74
+ end
75
+ end
76
+ end
77
+
78
+ context "when mocks are disabled" do
79
+ before(:each) { DefraRubyMocks.configuration.enable = false }
80
+ let(:payment_id) { Faker::Alphanumeric.alphanumeric(number: 26) }
81
+
82
+ context "POST #govpay_payments" do
83
+ let(:path) { "/defra_ruby_mocks/govpay/payments" }
84
+
85
+ it "cannot load the page" do
86
+ expect { post path }.to raise_error(ActionController::RoutingError)
87
+ end
88
+ end
89
+
90
+ context "GET #govpay_payments" do
91
+ let(:path) { "/defra_ruby_mocks/govpay/payments/#{payment_id}" }
92
+
93
+ it "cannot load the page" do
94
+ expect { get path }.to raise_error(ActionController::RoutingError)
95
+ end
96
+ end
97
+
98
+ context "#govpay_refunds" do
99
+ let(:path) { "/defra_ruby_mocks/govpay/#{payment_id}/refunds" }
100
+
101
+ it "cannot load the page" do
102
+ expect { post path }.to raise_error(ActionController::RoutingError)
103
+ end
104
+ end
105
+ end
106
+ end
107
+ end
@@ -24,7 +24,7 @@ module DefraRubyMocks
24
24
  let(:data) { File.read("spec/fixtures/payment_request_valid.xml") }
25
25
 
26
26
  it "returns an XML response with a 200 code" do
27
- get path, headers: { "RAW_POST_DATA" => data }
27
+ post path, headers: { "RAW_POST_DATA" => data }
28
28
 
29
29
  expect(response.media_type).to eq("application/xml")
30
30
  expect(response.code).to eq("200")
@@ -36,7 +36,7 @@ module DefraRubyMocks
36
36
  let(:data) { File.read("spec/fixtures/payment_request_invalid.xml") }
37
37
 
38
38
  it "returns a response with a 500 code" do
39
- get path, headers: { "RAW_POST_DATA" => data }
39
+ post path, headers: { "RAW_POST_DATA" => data }
40
40
 
41
41
  expect(response.code).to eq("500")
42
42
  end
@@ -48,7 +48,7 @@ module DefraRubyMocks
48
48
  let(:data) { File.read("spec/fixtures/refund_request_valid.xml") }
49
49
 
50
50
  it "returns an XML response with a 200 code" do
51
- get path, headers: { "RAW_POST_DATA" => data }
51
+ post path, headers: { "RAW_POST_DATA" => data }
52
52
 
53
53
  expect(response.media_type).to eq("application/xml")
54
54
  expect(response.code).to eq("200")
@@ -44,6 +44,14 @@ module DefraRubyMocks
44
44
  it "returns an object with the expected company name" do
45
45
  expect(described_class.run(args).company_name).to eq(company_name.downcase)
46
46
  end
47
+
48
+ context "when the company name is not populated" do
49
+ let(:company_name) { nil }
50
+
51
+ it "returns the object" do
52
+ expect(described_class.run(args).resource).to eq(resource)
53
+ end
54
+ end
47
55
  end
48
56
 
49
57
  context "when the resource is a Registration" do
@@ -16,7 +16,7 @@ module DefraRubyMocks
16
16
  allow(WorldpayResourceService).to receive(:run) { resource }
17
17
  end
18
18
 
19
- let(:resource) { double(:resource, order: order, company_name: company_name.downcase) }
19
+ let(:resource) { double(:resource, order: order, company_name: company_name&.downcase) }
20
20
 
21
21
  let(:admin_code) { "admincode1" }
22
22
  let(:merchant_code) { "merchantcode1" }
@@ -75,7 +75,6 @@ module DefraRubyMocks
75
75
 
76
76
  context "and is for a successful payment" do
77
77
  it "can generate a valid mac" do
78
- puts "Test data #{mac_data.join}"
79
78
  expect(described_class.run(args).mac).to eq(mac)
80
79
  end
81
80
 
@@ -84,6 +83,14 @@ module DefraRubyMocks
84
83
 
85
84
  expect(described_class.run(args).url).to eq(expected_response_url)
86
85
  end
86
+
87
+ context "and the company name is blank" do
88
+ let(:company_name) { nil }
89
+
90
+ it "can extract the reference from the `success_url`" do
91
+ expect(described_class.run(args).reference).to eq(reference)
92
+ end
93
+ end
87
94
  end
88
95
 
89
96
  context "and is for a rejected payment" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: defra_ruby_mocks
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Defra
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-10 00:00:00.000000000 Z
11
+ date: 2022-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -149,9 +149,12 @@ files:
149
149
  - Rakefile
150
150
  - app/controllers/defra_ruby_mocks/application_controller.rb
151
151
  - app/controllers/defra_ruby_mocks/company_controller.rb
152
+ - app/controllers/defra_ruby_mocks/govpay_controller.rb
152
153
  - app/controllers/defra_ruby_mocks/worldpay_controller.rb
153
154
  - app/services/defra_ruby_mocks/base_service.rb
154
155
  - app/services/defra_ruby_mocks/companies_house_service.rb
156
+ - app/services/defra_ruby_mocks/govpay_create_payment_service.rb
157
+ - app/services/defra_ruby_mocks/govpay_get_payment_service.rb
155
158
  - app/services/defra_ruby_mocks/worldpay_payment_service.rb
156
159
  - app/services/defra_ruby_mocks/worldpay_refund_service.rb
157
160
  - app/services/defra_ruby_mocks/worldpay_request_handler_service.rb
@@ -218,6 +221,7 @@ files:
218
221
  - spec/lib/configuration_spec.rb
219
222
  - spec/rails_helper.rb
220
223
  - spec/requests/company_spec.rb
224
+ - spec/requests/govpay_spec.rb
221
225
  - spec/requests/officers_spec.rb
222
226
  - spec/requests/worldpay_spec.rb
223
227
  - spec/services/companies_house_service_spec.rb
@@ -237,7 +241,7 @@ homepage: https://github.com/DEFRA/defra-ruby-mocks
237
241
  licenses:
238
242
  - The Open Government Licence (OGL) Version 3
239
243
  metadata: {}
240
- post_install_message:
244
+ post_install_message:
241
245
  rdoc_options: []
242
246
  require_paths:
243
247
  - lib
@@ -245,7 +249,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
245
249
  requirements:
246
250
  - - ">="
247
251
  - !ruby/object:Gem::Version
248
- version: '0'
252
+ version: '2.4'
249
253
  required_rubygems_version: !ruby/object:Gem::Requirement
250
254
  requirements:
251
255
  - - ">="
@@ -253,7 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
253
257
  version: '0'
254
258
  requirements: []
255
259
  rubygems_version: 3.1.2
256
- signing_key:
260
+ signing_key:
257
261
  specification_version: 4
258
262
  summary: Defra Ruby on Rails external API mocking engine
259
263
  test_files:
@@ -295,6 +299,7 @@ test_files:
295
299
  - spec/dummy/README.rdoc
296
300
  - spec/examples.txt
297
301
  - spec/defra_ruby_mocks_spec.rb
302
+ - spec/requests/govpay_spec.rb
298
303
  - spec/requests/company_spec.rb
299
304
  - spec/requests/worldpay_spec.rb
300
305
  - spec/requests/officers_spec.rb