defra_ruby_mocks 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/spec/examples.txt CHANGED
@@ -1,99 +1,114 @@
1
1
  example_id | status | run_time |
2
2
  ------------------------------------------------------------------- | ------ | --------------- |
3
- ./spec/defra_ruby_mocks_spec.rb[1:1:1] | passed | 0.00123 seconds |
4
- ./spec/defra_ruby_mocks_spec.rb[1:2:1:1] | passed | 0.00062 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.00008 seconds |
7
- ./spec/lib/configuration_spec.rb[1:1:2:1] | passed | 0.00008 seconds |
8
- ./spec/lib/configuration_spec.rb[1:1:3:1] | passed | 0.0001 seconds |
9
- ./spec/lib/configuration_spec.rb[1:1:4:1] | passed | 0.00008 seconds |
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
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.00157 seconds |
12
- ./spec/lib/configuration_spec.rb[1:2:3:1] | passed | 0.00009 seconds |
13
- ./spec/lib/configuration_spec.rb[1:2:4:1] | passed | 0.00011 seconds |
14
- ./spec/requests/company_spec.rb[1:1:1:1] | passed | 0.00337 seconds |
15
- ./spec/requests/company_spec.rb[1:1:2:1] | passed | 0.00603 seconds |
16
- ./spec/requests/company_spec.rb[1:1:3:1:1] | passed | 0.00406 seconds |
17
- ./spec/requests/company_spec.rb[1:1:3:2:1] | passed | 0.00906 seconds |
18
- ./spec/requests/company_spec.rb[1:2:1] | passed | 0.00374 seconds |
19
- ./spec/requests/worldpay_spec.rb[1:1:1:1:1:1] | passed | 0.00694 seconds |
20
- ./spec/requests/worldpay_spec.rb[1:1:1:1:2:1] | passed | 0.0037 seconds |
21
- ./spec/requests/worldpay_spec.rb[1:1:1:2:1:1] | passed | 0.00561 seconds |
22
- ./spec/requests/worldpay_spec.rb[1:1:2:1:1:1] | passed | 0.00692 seconds |
23
- ./spec/requests/worldpay_spec.rb[1:1:2:1:2:1] | passed | 0.03455 seconds |
24
- ./spec/requests/worldpay_spec.rb[1:1:2:2:1:1] | passed | 0.00329 seconds |
25
- ./spec/requests/worldpay_spec.rb[1:2:1:1] | passed | 0.00155 seconds |
26
- ./spec/requests/worldpay_spec.rb[1:2:2:1] | passed | 0.01827 seconds |
27
- ./spec/services/companies_house_service_spec.rb[1:1:1:1] | passed | 0.00133 seconds |
28
- ./spec/services/companies_house_service_spec.rb[1:1:2:1:1] | passed | 0.00008 seconds |
29
- ./spec/services/companies_house_service_spec.rb[1:1:2:2:1] | passed | 0.0001 seconds |
30
- ./spec/services/companies_house_service_spec.rb[1:1:2:3:1] | passed | 0.00009 seconds |
31
- ./spec/services/companies_house_service_spec.rb[1:1:2:4:1] | passed | 0.00008 seconds |
32
- ./spec/services/companies_house_service_spec.rb[1:1:2:5:1] | passed | 0.119 seconds |
33
- ./spec/services/companies_house_service_spec.rb[1:1:2:6:1] | passed | 0.00009 seconds |
34
- ./spec/services/companies_house_service_spec.rb[1:1:2:7:1] | passed | 0.00008 seconds |
35
- ./spec/services/companies_house_service_spec.rb[1:1:2:8:1] | passed | 0.00016 seconds |
36
- ./spec/services/companies_house_service_spec.rb[1:1:2:9:1] | passed | 0.00009 seconds |
37
- ./spec/services/companies_house_service_spec.rb[1:1:3:1:1] | passed | 0.00012 seconds |
38
- ./spec/services/companies_house_service_spec.rb[1:1:3:2:1] | passed | 0.00012 seconds |
39
- ./spec/services/worldpay_payment_service_spec.rb[1:1:1:1] | passed | 0.00015 seconds |
40
- ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:1] | passed | 0.00032 seconds |
41
- ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:2] | passed | 0.00035 seconds |
42
- ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:3] | passed | 0.00031 seconds |
11
+ ./spec/lib/configuration_spec.rb[1:2:2:1] | passed | 0.00013 seconds |
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 |
43
58
  ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:4] | passed | 0.00033 seconds |
44
59
  ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:5:1] | passed | 0.00028 seconds |
45
- ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:5:2] | passed | 0.00032 seconds |
46
- ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:5:3] | passed | 0.00042 seconds |
47
- ./spec/services/worldpay_payment_service_spec.rb[1:1:2:1:6:1] | passed | 0.00029 seconds |
48
- ./spec/services/worldpay_payment_service_spec.rb[1:1:3:1] | passed | 0.00026 seconds |
49
- ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:1] | passed | 0.00035 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 |
62
+ ./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 |
50
65
  ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:2] | passed | 0.00034 seconds |
51
- ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:3] | passed | 0.00036 seconds |
52
- ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:4] | passed | 0.00034 seconds |
53
- ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:5] | passed | 0.0004 seconds |
54
- ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:6] | passed | 0.0004 seconds |
55
- ./spec/services/worldpay_refund_service_spec.rb[1:1:1:1:7] | passed | 0.00035 seconds |
56
- ./spec/services/worldpay_refund_service_spec.rb[1:1:2:1] | passed | 0.00069 seconds |
57
- ./spec/services/worldpay_request_handler_service_spec.rb[1:1:1:1:1] | passed | 0.00169 seconds |
58
- ./spec/services/worldpay_request_handler_service_spec.rb[1:1:1:1:2] | passed | 0.00133 seconds |
59
- ./spec/services/worldpay_request_handler_service_spec.rb[1:1:1:2:1] | passed | 0.00062 seconds |
60
- ./spec/services/worldpay_request_handler_service_spec.rb[1:1:1:2:2] | passed | 0.00074 seconds |
61
- ./spec/services/worldpay_request_handler_service_spec.rb[1:1:1:3:1] | passed | 0.00082 seconds |
62
- ./spec/services/worldpay_resource_service_spec.rb[1:1:1:1] | passed | 0.00547 seconds |
63
- ./spec/services/worldpay_resource_service_spec.rb[1:1:1:2] | passed | 0.00091 seconds |
64
- ./spec/services/worldpay_resource_service_spec.rb[1:1:1:3] | passed | 0.00076 seconds |
65
- ./spec/services/worldpay_resource_service_spec.rb[1:1:1:4] | passed | 0.00126 seconds |
66
- ./spec/services/worldpay_resource_service_spec.rb[1:1:2:1] | passed | 0.0034 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 |
67
82
  ./spec/services/worldpay_resource_service_spec.rb[1:1:2:2] | passed | 0.0011 seconds |
68
- ./spec/services/worldpay_resource_service_spec.rb[1:1:2:3] | passed | 0.00105 seconds |
69
- ./spec/services/worldpay_resource_service_spec.rb[1:1:2:4] | passed | 0.00093 seconds |
70
- ./spec/services/worldpay_resource_service_spec.rb[1:1:3:1] | passed | 0.00153 seconds |
71
- ./spec/services/worldpay_resource_service_spec.rb[1:1:4:1] | passed | 0.00087 seconds |
72
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:1] | passed | 0.00048 seconds |
73
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:2] | passed | 0.00068 seconds |
74
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:3:1] | passed | 0.00058 seconds |
75
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:3:2] | passed | 0.00064 seconds |
76
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:4:1] | passed | 0.00053 seconds |
77
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:4:2] | passed | 0.00066 seconds |
78
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:5:1] | passed | 0.00048 seconds |
79
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:5:2] | passed | 0.00056 seconds |
80
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:6:1] | passed | 0.00068 seconds |
81
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:6:2] | passed | 0.00059 seconds |
82
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:7:1] | passed | 0.00115 seconds |
83
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:7:2] | passed | 0.00119 seconds |
84
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:8:1] | passed | 0.0006 seconds |
85
- ./spec/services/worldpay_response_service_spec.rb[1:1:1:1:8:2] | passed | 0.00057 seconds |
86
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:1] | passed | 0.00054 seconds |
87
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:2] | passed | 0.00058 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 |
88
103
  ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:3:1] | passed | 0.00063 seconds |
89
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:3:2] | passed | 0.00065 seconds |
90
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:4:1] | passed | 0.00063 seconds |
91
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:4:2] | passed | 0.00066 seconds |
92
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:5:1] | passed | 0.00056 seconds |
93
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:5:2] | passed | 0.00056 seconds |
94
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:6:1] | passed | 0.00054 seconds |
95
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:6:2] | passed | 0.00058 seconds |
96
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:7:1] | passed | 0.00078 seconds |
97
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:7:2] | passed | 0.00081 seconds |
98
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:8:1] | passed | 0.00053 seconds |
99
- ./spec/services/worldpay_response_service_spec.rb[1:1:2:1:8:2] | passed | 0.00056 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 |
@@ -29,11 +29,20 @@ module DefraRubyMocks
29
29
 
30
30
  it "returns a JSON response with a 200 code and a status that isn't 'active'" do
31
31
  get "#{path}/#{company_number}"
32
- company_status = JSON.parse(response.body)["company_status"]
33
32
 
34
33
  expect(response.media_type).to eq("application/json")
35
34
  expect(response.code).to eq("200")
36
- expect(company_status).not_to eq("active")
35
+ expect(JSON.parse(response.body).deep_symbolize_keys).to eq(
36
+ company_name: "Acme Industries",
37
+ company_status: "dissolved",
38
+ type: "ltd",
39
+ registered_office_address: {
40
+ address_line_1: "10 Downing St",
41
+ address_line_2: "Horizon House",
42
+ locality: "Bristol",
43
+ postal_code: "BS1 5AH"
44
+ }
45
+ )
37
46
  end
38
47
  end
39
48
 
@@ -44,10 +53,12 @@ module DefraRubyMocks
44
53
  it "returns a JSON response with a 200 code and a status of 'active'" do
45
54
  get "#{path}/#{company_number}"
46
55
  company_status = JSON.parse(response.body)["company_status"]
56
+ company_type = JSON.parse(response.body)["type"]
47
57
 
48
58
  expect(response.media_type).to eq("application/json")
49
59
  expect(response.code).to eq("200")
50
60
  expect(company_status).to eq("active")
61
+ expect(company_type).to eq("ltd")
51
62
  end
52
63
  end
53
64
 
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails_helper"
4
+
5
+ module DefraRubyMocks
6
+ RSpec.describe "Officers", type: :request do
7
+ after(:all) { Helpers::Configuration.reset_for_tests }
8
+
9
+ let(:path) { "/defra_ruby_mocks/company/company-no/officers" }
10
+
11
+ context "when mocks are enabled" do
12
+ before(:each) { Helpers::Configuration.prep_for_tests }
13
+
14
+ it "returns a JSON response" do
15
+ get path
16
+
17
+ expect(response.media_type).to eq("application/json")
18
+ expect(response.code).to eq("200")
19
+
20
+ expect(JSON.parse(response.body).deep_symbolize_keys[:items][0]).to eq(
21
+ {
22
+ name: "APPLE, Alice",
23
+ officer_role: "director"
24
+ }
25
+ )
26
+ end
27
+ end
28
+
29
+ context "when mocks are disabled" do
30
+ before(:all) { DefraRubyMocks.configuration.enable = false }
31
+
32
+ it "cannot load the page" do
33
+ expect { get path }.to raise_error(ActionController::RoutingError)
34
+ end
35
+ end
36
+ end
37
+ end
@@ -5,11 +5,13 @@ require "rails_helper"
5
5
  module DefraRubyMocks
6
6
  RSpec.describe CompaniesHouseService do
7
7
  describe ".run" do
8
+ subject { described_class.run(company_number) }
9
+
8
10
  context "when the company number is 99999999 for not found" do
9
11
  let(:company_number) { "99999999" }
10
12
 
11
13
  it "raises a NotFoundError" do
12
- expect { described_class.run(company_number) }.to raise_error(NotFoundError)
14
+ expect { subject }.to raise_error(NotFoundError)
13
15
  end
14
16
  end
15
17
 
@@ -18,19 +20,39 @@ module DefraRubyMocks
18
20
 
19
21
  specials.each do |company_number, status|
20
22
  context "and the number is #{company_number}" do
21
- it "returns a status of '#{status}'" do
22
- expect(described_class.run(company_number)).to eq(status)
23
+ let(:company_number) { company_number }
24
+
25
+ it "returns a company_status of '#{status}'" do
26
+ expect(subject.company_status).to eq(status)
27
+ end
28
+
29
+ it "returns a company_type of 'ltd'" do
30
+ expect(subject.company_type).to eq("ltd")
23
31
  end
24
32
  end
25
33
  end
26
34
  end
27
35
 
36
+ context "when the company is an LLP" do
37
+ CompaniesHouseService.llp_company_numbers.each do |company_number|
38
+ let(:company_number) { company_number }
39
+
40
+ it "returns a company_status of 'active'" do
41
+ expect(subject.company_status).to eq("active")
42
+ end
43
+
44
+ it "returns a company_type of 'llp'" do
45
+ expect(subject.company_type).to eq("llp")
46
+ end
47
+ end
48
+ end
49
+
28
50
  context "when the company number is not from the 'specials' list" do
29
51
  context "and it is valid" do
30
52
  let(:company_number) { "SC247974" }
31
53
 
32
- it "returns a status of 'active'" do
33
- expect(described_class.run(company_number)).to eq("active")
54
+ it "returns a company_status of 'active'" do
55
+ expect(subject.company_status).to eq("active")
34
56
  end
35
57
  end
36
58
 
@@ -38,7 +60,7 @@ module DefraRubyMocks
38
60
  let(:company_number) { "foo" }
39
61
 
40
62
  it "raises a NotFoundError" do
41
- expect { described_class.run(company_number) }.to raise_error(NotFoundError)
63
+ expect { subject }.to raise_error(NotFoundError)
42
64
  end
43
65
  end
44
66
  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.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Defra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-31 00:00:00.000000000 Z
11
+ date: 2022-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -158,6 +158,7 @@ files:
158
158
  - app/services/defra_ruby_mocks/worldpay_resource_service.rb
159
159
  - app/services/defra_ruby_mocks/worldpay_response_service.rb
160
160
  - app/views/defra_ruby_mocks/company/not_found.json.erb
161
+ - app/views/defra_ruby_mocks/company/officers.json.erb
161
162
  - app/views/defra_ruby_mocks/company/show.json.erb
162
163
  - app/views/defra_ruby_mocks/worldpay/payment_request.xml.erb
163
164
  - app/views/defra_ruby_mocks/worldpay/refund_request.xml.erb
@@ -217,6 +218,7 @@ files:
217
218
  - spec/lib/configuration_spec.rb
218
219
  - spec/rails_helper.rb
219
220
  - spec/requests/company_spec.rb
221
+ - spec/requests/officers_spec.rb
220
222
  - spec/requests/worldpay_spec.rb
221
223
  - spec/services/companies_house_service_spec.rb
222
224
  - spec/services/worldpay_payment_service_spec.rb
@@ -295,6 +297,7 @@ test_files:
295
297
  - spec/defra_ruby_mocks_spec.rb
296
298
  - spec/requests/company_spec.rb
297
299
  - spec/requests/worldpay_spec.rb
300
+ - spec/requests/officers_spec.rb
298
301
  - spec/support/simplecov.rb
299
302
  - spec/support/pry.rb
300
303
  - spec/support/helpers/helpers.rb