defra_ruby_mocks 2.3.1 → 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,116 +1,121 @@
1
1
  example_id | status | run_time |
2
2
  ------------------------------------------------------------------- | ------ | --------------- |
3
- ./spec/defra_ruby_mocks_spec.rb[1:1:1] | passed | 0.00189 seconds |
4
- ./spec/defra_ruby_mocks_spec.rb[1:2:1:1] | passed | 0.00011 seconds |
5
- ./spec/defra_ruby_mocks_spec.rb[1:2:2:1] | passed | 0.00012 seconds |
6
- ./spec/lib/configuration_spec.rb[1:1:1:1] | passed | 0.0001 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
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.00008 seconds |
8
+ ./spec/lib/configuration_spec.rb[1:1:3:1] | passed | 0.0009 seconds |
9
9
  ./spec/lib/configuration_spec.rb[1:1:4:1] | passed | 0.00008 seconds |
10
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.00088 seconds |
12
- ./spec/lib/configuration_spec.rb[1:2:3:1] | passed | 0.00008 seconds |
11
+ ./spec/lib/configuration_spec.rb[1:2:2:1] | passed | 0.00008 seconds |
12
+ ./spec/lib/configuration_spec.rb[1:2:3:1] | passed | 0.0001 seconds |
13
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.0019 seconds |
15
- ./spec/requests/company_spec.rb[1:1:2:1] | passed | 0.00201 seconds |
16
- ./spec/requests/company_spec.rb[1:1:3:1:1] | passed | 0.0046 seconds |
17
- ./spec/requests/company_spec.rb[1:1:3:2:1] | passed | 0.00526 seconds |
18
- ./spec/requests/company_spec.rb[1:2:1] | passed | 0.00309 seconds |
19
- ./spec/requests/officers_spec.rb[1:1:1] | passed | 0.00328 seconds |
20
- ./spec/requests/officers_spec.rb[1:2:1] | passed | 0.00118 seconds |
21
- ./spec/requests/worldpay_spec.rb[1:1:1:1:1:1] | passed | 0.01098 seconds |
22
- ./spec/requests/worldpay_spec.rb[1:1:1:1:2:1] | passed | 0.00331 seconds |
23
- ./spec/requests/worldpay_spec.rb[1:1:1:2:1:1] | passed | 0.00337 seconds |
24
- ./spec/requests/worldpay_spec.rb[1:1:2:1:1:1] | passed | 0.00427 seconds |
25
- ./spec/requests/worldpay_spec.rb[1:1:2:1:2:1] | passed | 0.0222 seconds |
26
- ./spec/requests/worldpay_spec.rb[1:1:2:2:1:1] | passed | 0.0023 seconds |
27
- ./spec/requests/worldpay_spec.rb[1:2:1:1] | passed | 0.01006 seconds |
28
- ./spec/requests/worldpay_spec.rb[1:2:2:1] | passed | 0.00463 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 |
29
36
  ./spec/services/companies_house_service_spec.rb[1:1:1:1] | passed | 0.00011 seconds |
30
- ./spec/services/companies_house_service_spec.rb[1:1:2:1:1] | passed | 0.00007 seconds |
37
+ ./spec/services/companies_house_service_spec.rb[1:1:2:1:1] | passed | 0.00008 seconds |
31
38
  ./spec/services/companies_house_service_spec.rb[1:1:2:1:2] | passed | 0.00009 seconds |
32
39
  ./spec/services/companies_house_service_spec.rb[1:1:2:2:1] | passed | 0.00008 seconds |
33
- ./spec/services/companies_house_service_spec.rb[1:1:2:2:2] | passed | 0.00008 seconds |
40
+ ./spec/services/companies_house_service_spec.rb[1:1:2:2:2] | passed | 0.00014 seconds |
34
41
  ./spec/services/companies_house_service_spec.rb[1:1:2:3:1] | passed | 0.00008 seconds |
35
- ./spec/services/companies_house_service_spec.rb[1:1:2:3:2] | passed | 0.00007 seconds |
36
- ./spec/services/companies_house_service_spec.rb[1:1:2:4:1] | passed | 0.00008 seconds |
37
- ./spec/services/companies_house_service_spec.rb[1:1:2:4:2] | passed | 0.00007 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 |
38
45
  ./spec/services/companies_house_service_spec.rb[1:1:2:5:1] | passed | 0.00008 seconds |
39
- ./spec/services/companies_house_service_spec.rb[1:1:2:5:2] | passed | 0.00007 seconds |
46
+ ./spec/services/companies_house_service_spec.rb[1:1:2:5:2] | passed | 0.00008 seconds |
40
47
  ./spec/services/companies_house_service_spec.rb[1:1:2:6:1] | passed | 0.00008 seconds |
41
- ./spec/services/companies_house_service_spec.rb[1:1:2:6:2] | passed | 0.00008 seconds |
42
- ./spec/services/companies_house_service_spec.rb[1:1:2:7:1] | passed | 0.00008 seconds |
43
- ./spec/services/companies_house_service_spec.rb[1:1:2:7:2] | passed | 0.00007 seconds |
44
- ./spec/services/companies_house_service_spec.rb[1:1:2:8: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 |
45
52
  ./spec/services/companies_house_service_spec.rb[1:1:2:8:2] | passed | 0.00008 seconds |
46
- ./spec/services/companies_house_service_spec.rb[1:1:2:9:1] | passed | 0.00009 seconds |
53
+ ./spec/services/companies_house_service_spec.rb[1:1:2:9:1] | passed | 0.00008 seconds |
47
54
  ./spec/services/companies_house_service_spec.rb[1:1:2:9:2] | passed | 0.00008 seconds |
48
- ./spec/services/companies_house_service_spec.rb[1:1:3:1] | passed | 0.00009 seconds |
55
+ ./spec/services/companies_house_service_spec.rb[1:1:3:1] | passed | 0.00008 seconds |
49
56
  ./spec/services/companies_house_service_spec.rb[1:1:3:2] | passed | 0.0001 seconds |
50
- ./spec/services/companies_house_service_spec.rb[1:1:3:3] | passed | 0.00008 seconds |
51
- ./spec/services/companies_house_service_spec.rb[1:1:3:4] | passed | 0.00008 seconds |
52
- ./spec/services/companies_house_service_spec.rb[1:1:4:1:1] | passed | 0.00009 seconds |
53
- ./spec/services/companies_house_service_spec.rb[1:1:4:2:1] | 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 |
54
61
  ./spec/services/worldpay_payment_service_spec.rb[1:1:1:1] | passed | 0.00011 seconds |
55
- ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:1] | passed | 0.00031 seconds |
62
+ ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:1] | passed | 0.0003 seconds |
56
63
  ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:2] | passed | 0.00033 seconds |
57
- ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:3] | passed | 0.00033 seconds |
58
- ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:4] | passed | 0.00032 seconds |
59
- ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:5:1] | passed | 0.00031 seconds |
60
- ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:5:2] | passed | 0.00034 seconds |
61
- ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:5:3] | passed | 0.00041 seconds |
62
- ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:6:1] | passed | 0.00035 seconds |
63
- ./spec/services/worldpay_payment_service_spec.rb[1:1:3:1] | passed | 0.00029 seconds |
64
- ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:1] | passed | 0.00169 seconds |
65
- ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:2] | passed | 0.00205 seconds |
66
- ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:3] | passed | 0.00047 seconds |
67
- ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:4] | passed | 0.00034 seconds |
68
- ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:5] | passed | 0.00037 seconds |
69
- ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:6] | passed | 0.00036 seconds |
70
- ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:7] | passed | 0.00038 seconds |
71
- ./spec/services/worldpay_refund_service_spec.rb[1:1:2:1] | passed | 0.00072 seconds |
72
- ./spec/services/worldpay_request_handler_service_spec.rb[1:1:1:1:1] | passed | 0.00074 seconds |
73
- ./spec/services/worldpay_request_handler_service_spec.rb[1:1:1:1:2] | passed | 0.00074 seconds |
74
- ./spec/services/worldpay_request_handler_service_spec.rb[1:1:1:2:1] | passed | 0.00058 seconds |
75
- ./spec/services/worldpay_request_handler_service_spec.rb[1:1:1:2:2] | passed | 0.00074 seconds |
76
- ./spec/services/worldpay_request_handler_service_spec.rb[1:1:1:3:1] | passed | 0.00074 seconds |
77
- ./spec/services/worldpay_resource_service_spec.rb[1:1:1:1] | passed | 0.00056 seconds |
78
- ./spec/services/worldpay_resource_service_spec.rb[1:1:1:2] | passed | 0.00051 seconds |
79
- ./spec/services/worldpay_resource_service_spec.rb[1:1:1:3] | passed | 0.0005 seconds |
64
+ ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:3] | passed | 0.00028 seconds |
65
+ ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:4] | passed | 0.00033 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 |
69
+ ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:6:1] | passed | 0.00033 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 |
80
87
  ./spec/services/worldpay_resource_service_spec.rb[1:1:1:4] | passed | 0.00047 seconds |
81
- ./spec/services/worldpay_resource_service_spec.rb[1:1:1:5:1] | passed | 0.00048 seconds |
82
- ./spec/services/worldpay_resource_service_spec.rb[1:1:2:1] | passed | 0.00158 seconds |
83
- ./spec/services/worldpay_resource_service_spec.rb[1:1:2:2] | passed | 0.00129 seconds |
84
- ./spec/services/worldpay_resource_service_spec.rb[1:1:2:3] | passed | 0.00057 seconds |
85
- ./spec/services/worldpay_resource_service_spec.rb[1:1:2:4] | passed | 0.00053 seconds |
86
- ./spec/services/worldpay_resource_service_spec.rb[1:1:3:1] | passed | 0.00094 seconds |
87
- ./spec/services/worldpay_resource_service_spec.rb[1:1:4:1] | passed | 0.1673 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 |
88
94
  ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:1] | passed | 0.00048 seconds |
89
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:2] | passed | 0.00061 seconds |
90
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:3:1] | passed | 0.00048 seconds |
91
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:3:2] | passed | 0.00053 seconds |
92
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:3:3:1] | passed | 0.00047 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 |
93
98
  ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:4:1] | passed | 0.00044 seconds |
94
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:4:2] | passed | 0.00046 seconds |
95
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:5:1] | passed | 0.00048 seconds |
96
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:5:2] | passed | 0.00042 seconds |
97
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:6:1] | passed | 0.00046 seconds |
98
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:6:2] | passed | 0.00051 seconds |
99
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:7: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 |
100
105
  ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:7:2] | passed | 0.00047 seconds |
101
106
  ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:8:1] | passed | 0.00046 seconds |
102
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:8:2] | passed | 0.00049 seconds |
103
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:1] | passed | 0.0005 seconds |
104
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:2] | passed | 0.0005 seconds |
105
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:3:1] | passed | 0.00046 seconds |
106
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:3:2] | passed | 0.0005 seconds |
107
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:4:1] | passed | 0.00046 seconds |
108
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:4:2] | passed | 0.00046 seconds |
109
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:5:1] | passed | 0.00045 seconds |
110
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:5:2] | passed | 0.00047 seconds |
111
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:6:1] | passed | 0.00048 seconds |
112
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:6:2] | passed | 0.00049 seconds |
113
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:7: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 |
114
119
  ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:7:2] | passed | 0.00047 seconds |
115
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:8:1] | passed | 0.00052 seconds |
116
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:8:2] | passed | 0.00056 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
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.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Defra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-14 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
@@ -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