noths 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.md +10 -23
  4. data/bin/generate_gem +3 -1
  5. data/bin/refresh_schemas +22 -16
  6. data/docs/AcceptanceBulkModel.md +2 -2
  7. data/docs/DispatchBulkModel.md +1 -1
  8. data/docs/Financials.md +1 -1
  9. data/docs/Order.md +12 -11
  10. data/docs/OrdersApi.md +104 -151
  11. data/docs/RefundsApi.md +8 -12
  12. data/git_push.sh +55 -0
  13. data/lib/noths.rb +1 -11
  14. data/lib/noths/api/orders_api.rb +234 -114
  15. data/lib/noths/api/refunds_api.rb +25 -15
  16. data/lib/noths/api_client.rb +3 -12
  17. data/lib/noths/api_error.rb +16 -11
  18. data/lib/noths/configuration.rb +3 -20
  19. data/lib/noths/models/acceptance_bulk_model.rb +3 -14
  20. data/lib/noths/models/currency.rb +1 -12
  21. data/lib/noths/models/decline_bulk_model.rb +1 -12
  22. data/lib/noths/models/delivery_address.rb +1 -12
  23. data/lib/noths/models/delivery_service.rb +1 -12
  24. data/lib/noths/models/delivery_zone.rb +1 -12
  25. data/lib/noths/models/dispatch_bulk_model.rb +2 -13
  26. data/lib/noths/models/dispatch_notes_bulk_model.rb +1 -12
  27. data/lib/noths/models/enquiry.rb +1 -12
  28. data/lib/noths/models/enquiry_message.rb +1 -12
  29. data/lib/noths/models/error.rb +1 -12
  30. data/lib/noths/models/financials.rb +5 -14
  31. data/lib/noths/models/financials_details.rb +1 -12
  32. data/lib/noths/models/image_url.rb +1 -12
  33. data/lib/noths/models/item.rb +1 -12
  34. data/lib/noths/models/item_financials.rb +1 -12
  35. data/lib/noths/models/link.rb +1 -12
  36. data/lib/noths/models/manual_payment.rb +1 -12
  37. data/lib/noths/models/money.rb +1 -12
  38. data/lib/noths/models/order.rb +28 -28
  39. data/lib/noths/models/order_detail.rb +1 -12
  40. data/lib/noths/models/order_details_bulk_model.rb +1 -12
  41. data/lib/noths/models/order_index.rb +1 -12
  42. data/lib/noths/models/order_refund.rb +1 -12
  43. data/lib/noths/models/product.rb +1 -12
  44. data/lib/noths/models/product_option.rb +1 -12
  45. data/lib/noths/models/refund_response.rb +1 -12
  46. data/lib/noths/models/search_result_meta.rb +1 -12
  47. data/lib/noths/models/user.rb +1 -12
  48. data/lib/noths/version.rb +2 -12
  49. data/noths.gemspec +1 -11
  50. data/schemas/api-docs.json +3 -7
  51. data/schemas/orders.json +163 -88
  52. data/schemas/refunds.json +10 -5
  53. data/spec/api/orders_api_spec.rb +53 -99
  54. data/spec/api/refunds_api_spec.rb +6 -28
  55. data/spec/api_client_spec.rb +2 -14
  56. data/spec/configuration_spec.rb +9 -25
  57. data/spec/models/acceptance_bulk_model_spec.rb +7 -38
  58. data/spec/models/currency_spec.rb +7 -38
  59. data/spec/models/decline_bulk_model_spec.rb +5 -32
  60. data/spec/models/delivery_address_spec.rb +9 -44
  61. data/spec/models/delivery_service_spec.rb +5 -32
  62. data/spec/models/delivery_zone_spec.rb +5 -32
  63. data/spec/models/dispatch_bulk_model_spec.rb +8 -41
  64. data/spec/models/dispatch_notes_bulk_model_spec.rb +4 -29
  65. data/spec/models/enquiry_message_spec.rb +4 -29
  66. data/spec/models/enquiry_spec.rb +6 -35
  67. data/spec/models/error_spec.rb +5 -32
  68. data/spec/models/financials_details_spec.rb +6 -35
  69. data/spec/models/financials_spec.rb +21 -80
  70. data/spec/models/image_url_spec.rb +9 -44
  71. data/spec/models/item_financials_spec.rb +9 -44
  72. data/spec/models/item_spec.rb +11 -50
  73. data/spec/models/link_spec.rb +6 -35
  74. data/spec/models/manual_payment_spec.rb +7 -38
  75. data/spec/models/money_spec.rb +5 -32
  76. data/spec/models/order_detail_spec.rb +5 -32
  77. data/spec/models/order_details_bulk_model_spec.rb +4 -29
  78. data/spec/models/order_index_spec.rb +6 -35
  79. data/spec/models/order_refund_spec.rb +4 -29
  80. data/spec/models/order_spec.rb +53 -164
  81. data/spec/models/product_option_spec.rb +5 -32
  82. data/spec/models/product_spec.rb +8 -41
  83. data/spec/models/refund_response_spec.rb +6 -35
  84. data/spec/models/search_result_meta_spec.rb +5 -32
  85. data/spec/models/user_spec.rb +6 -35
  86. data/spec/spec_helper.rb +1 -11
  87. data/swagger_config.json +1 -1
  88. data/templates/Gemfile.mustache +7 -0
  89. data/templates/README.mustache +127 -0
  90. data/templates/Rakefile.mustache +8 -0
  91. data/templates/api.mustache +194 -0
  92. data/templates/api_client.mustache +383 -0
  93. data/templates/api_client_spec.mustache +214 -0
  94. data/templates/api_doc.mustache +79 -0
  95. data/templates/api_error.mustache +43 -0
  96. data/templates/api_info.mustache +12 -0
  97. data/templates/api_test.mustache +29 -0
  98. data/templates/base_object.mustache +102 -0
  99. data/templates/base_object_spec.mustache +107 -0
  100. data/templates/configuration.mustache +221 -0
  101. data/templates/configuration_spec.mustache +26 -0
  102. data/templates/gem.mustache +38 -0
  103. data/templates/gemspec.mustache +41 -0
  104. data/templates/git_push.sh.mustache +55 -0
  105. data/templates/gitignore.mustache +35 -0
  106. data/templates/model.mustache +7 -0
  107. data/templates/model_doc.mustache +9 -0
  108. data/templates/model_test.mustache +19 -0
  109. data/templates/partial_model_enum_class.mustache +13 -0
  110. data/templates/partial_model_generic.mustache +275 -0
  111. data/templates/rspec.mustache +2 -0
  112. data/templates/spec_helper.mustache +101 -0
  113. data/templates/version.mustache +5 -0
  114. metadata +30 -3
@@ -9,6 +9,13 @@
9
9
  "operations": [
10
10
  {
11
11
  "parameters": [
12
+ {
13
+ "paramType": "query",
14
+ "name": "token",
15
+ "type": "string",
16
+ "description": "Authentication credential",
17
+ "required": true
18
+ },
12
19
  {
13
20
  "paramType": "path",
14
21
  "name": "order_id",
@@ -57,11 +64,9 @@
57
64
  ],
58
65
  "method": "post",
59
66
  "nickname": "Refunds#create",
60
- "authorizations": {
61
- "token": [
62
-
63
- ]
64
- }
67
+ "consumes": [
68
+ "application/x-www-form-urlencoded"
69
+ ]
65
70
  }
66
71
  ]
67
72
  }
@@ -1,38 +1,18 @@
1
- =begin
2
- #Noths
3
-
4
- #www.notonthehighstreet.com API client
5
-
6
- OpenAPI spec version: 1.0
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
12
-
13
- require 'spec_helper'
14
- require 'json'
1
+ # frozen_string_literal: true
15
2
 
16
3
  # Unit tests for Noths::OrdersApi
17
4
  # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
18
5
  # Please update as you see appropriate
19
6
  describe 'OrdersApi' do
20
- before do
21
- # run before each test
22
- @instance = Noths::OrdersApi.new
23
- end
24
-
25
- after do
26
- # run after each test
27
- end
7
+ let(:instance) { Noths::OrdersApi.new }
28
8
 
29
9
  describe 'test an instance of OrdersApi' do
30
10
  it 'should create an instance of OrdersApi' do
31
- expect(@instance).to be_instance_of(Noths::OrdersApi)
11
+ expect(instance).to be_instance_of(Noths::OrdersApi)
32
12
  end
33
13
  end
34
14
 
35
- # unit tests for api_v1_orders_acceptance
15
+ # unit tests for orders_acceptance
36
16
  # Accept an order
37
17
  # Accept an order that is in the placed state. Note: In rare instances orders may not transition to the 'accepted' state immediately.
38
18
  # @param token Authentication credential
@@ -42,26 +22,22 @@ describe 'OrdersApi' do
42
22
  # @param [Hash] opts the optional parameters
43
23
  # @option opts [String] :confirmation_note
44
24
  # @return [nil]
45
- describe 'api_v1_orders_acceptance test' do
46
- it "should work" do
47
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
48
- end
25
+ describe 'orders_acceptance test' do
26
+ it 'should work'
49
27
  end
50
28
 
51
- # unit tests for api_v1_orders_acceptance_bulk
29
+ # unit tests for orders_acceptance_bulk
52
30
  # Accept multiple orders
53
31
  # Returns an array of hashes containing order ids and status codes. A status code of 200 indicates that the order was eligible to be accepted and is expected to be processed successfully. This is not a guarantee that the order will be accepted. Processing acceptance is not instantaneous and may take some time while funds are captured. Example response: <pre> [ { \"id\": 12, \"status\": 200, \"errors\": [] }, { \"id\": 22, \"status\": 404, \"errors\": [ { \"code\": \"RESOURCE_NOT_FOUND\", \"title\": \"Couldn't find the requested resource\" } ] } ] </pre>
54
32
  # @param token Authentication credential
55
- # @param
33
+ # @param payload
56
34
  # @param [Hash] opts the optional parameters
57
35
  # @return [nil]
58
- describe 'api_v1_orders_acceptance_bulk test' do
59
- it "should work" do
60
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
61
- end
36
+ describe 'orders_acceptance_bulk test' do
37
+ it 'should work'
62
38
  end
63
39
 
64
- # unit tests for api_v1_orders_decline
40
+ # unit tests for orders_decline
65
41
  # Decline an order
66
42
  # Declines an order that is in the placed state
67
43
  # @param token Authentication credential
@@ -69,53 +45,45 @@ describe 'OrdersApi' do
69
45
  # @param decline_reason
70
46
  # @param [Hash] opts the optional parameters
71
47
  # @return [nil]
72
- describe 'api_v1_orders_decline test' do
73
- it "should work" do
74
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
75
- end
48
+ describe 'orders_decline test' do
49
+ it 'should work'
76
50
  end
77
51
 
78
- # unit tests for api_v1_orders_decline_bulk
52
+ # unit tests for orders_decline_bulk
79
53
  # Decline multiple orders
80
54
  # Returns an array of hashes containing order ids and status codes. A status code of 200 indicates a successful update whereas a code of 400 indicates failure. Example response: <pre> [ { \"id\": 12, \"status\": 200, \"errors\": [] }, { \"id\": 22, \"status\": 404, \"errors\": [ { \"code\": \"RESOURCE_NOT_FOUND\", \"title\": \"Couldn't find the requested resource\" } ] } ] </pre>
81
55
  # @param token Authentication credential
82
- # @param
56
+ # @param payload
83
57
  # @param [Hash] opts the optional parameters
84
58
  # @return [nil]
85
- describe 'api_v1_orders_decline_bulk test' do
86
- it "should work" do
87
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
88
- end
59
+ describe 'orders_decline_bulk test' do
60
+ it 'should work'
89
61
  end
90
62
 
91
- # unit tests for api_v1_orders_dispatch_note
63
+ # unit tests for orders_dispatch_note
92
64
  # Generate a dispatch note pdf or gift note pdf.
93
65
  # Force the kind of document by passing the force_type parameter. A gift note can only be printed for an order that is a gift, which will be the default behaviour.<p/>Here is an example of how to obtain a pdf using curl: <pre>curl -XPOST [URL] > document.pdf</pre>
94
66
  # @param token Authentication credential
95
67
  # @param id Order id
96
68
  # @param [Hash] opts the optional parameters
97
69
  # @option opts [String] :force_type Type of document
98
- # @return [nil]
99
- describe 'api_v1_orders_dispatch_note test' do
100
- it "should work" do
101
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
102
- end
70
+ # @return [File]
71
+ describe 'orders_dispatch_note test' do
72
+ it 'should work'
103
73
  end
104
74
 
105
- # unit tests for api_v1_orders_dispatch_notes_bulk
75
+ # unit tests for orders_dispatch_notes_bulk
106
76
  # Generate pdf with dispatch note for each order
107
77
  # <p/> Here is an example of how to obtain a pdf using curl: <pre>curl -H \"Content-Type: application/json\" -d '[{\"id\": 123}, {\"id\": 456}]' -XPOST [URL] > document.pdf</pre><p/> Ensure that the Content-Type header is set to \"Content-Type: application/json\".<p/>
108
78
  # @param token Authentication credential
109
- # @param
79
+ # @param payload
110
80
  # @param [Hash] opts the optional parameters
111
- # @return [nil]
112
- describe 'api_v1_orders_dispatch_notes_bulk test' do
113
- it "should work" do
114
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
115
- end
81
+ # @return [File]
82
+ describe 'orders_dispatch_notes_bulk test' do
83
+ it 'should work'
116
84
  end
117
85
 
118
- # unit tests for api_v1_orders_dispatch_order
86
+ # unit tests for orders_dispatch_order
119
87
  # Dispatch an order
120
88
  # Dispatches an order that is in an accepted state and has also had its dispatch note printed
121
89
  # @param token Authentication credential
@@ -127,27 +95,23 @@ describe 'OrdersApi' do
127
95
  # @option opts [String] :parcel_tracking_url
128
96
  # @option opts [BOOLEAN] :ignore_unresolved_enquiries Defaults to false
129
97
  # @return [nil]
130
- describe 'api_v1_orders_dispatch_order test' do
131
- it "should work" do
132
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
133
- end
98
+ describe 'orders_dispatch_order test' do
99
+ it 'should work'
134
100
  end
135
101
 
136
- # unit tests for api_v1_orders_dispatch_orders_bulk
102
+ # unit tests for orders_dispatch_orders_bulk
137
103
  # Dispatch multiple orders
138
104
  # Returns an array of hashes containing order ids and status codes. A status code of 200 indicates a successful update whereas a code of 400 indicates failure. Example response: <pre> [ { \"id\": 12, \"status\": 200, \"errors\": [] }, { \"id\": 22, \"status\": 404, \"errors\": [ { \"code\": \"RESOURCE_NOT_FOUND\", \"title\": \"Couldn't find the requested resource\" } ] } ] </pre>
139
105
  # @param token Authentication credential
140
- # @param
106
+ # @param payload
141
107
  # @param [Hash] opts the optional parameters
142
108
  # @option opts [BOOLEAN] :ignore_unresolved_enquiries Defaults to false
143
109
  # @return [nil]
144
- describe 'api_v1_orders_dispatch_orders_bulk test' do
145
- it "should work" do
146
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
147
- end
110
+ describe 'orders_dispatch_orders_bulk test' do
111
+ it 'should work'
148
112
  end
149
113
 
150
- # unit tests for api_v1_orders_index
114
+ # unit tests for orders_index
151
115
  # Fetch orders
152
116
  # Lists orders descending by placed at time by default.<p/>If you just want a count, use per_page=0 and offset=0 .
153
117
  # @param token Authentication credential
@@ -174,55 +138,47 @@ describe 'OrdersApi' do
174
138
  # @option opts [String] :query Matches your query to information related to your orders
175
139
  # @option opts [BOOLEAN] :repeat_customer
176
140
  # @option opts [String] :sort Defaults to placed_at
177
- # @option opts [String] :state State
141
+ # @option opts [Array<String>] :state State
178
142
  # @return [OrderIndex]
179
- describe 'api_v1_orders_index test' do
180
- it "should work" do
181
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
182
- end
143
+ describe 'orders_index test' do
144
+ it 'should work'
183
145
  end
184
146
 
185
- # unit tests for api_v1_orders_invoice
147
+ # unit tests for orders_invoice
186
148
  # Generate a vat invoice pdf.
187
149
  # &lt;p&gt;Invoices are currently only applicable for the UK site&lt;/p&gt;Here is an example of how to obtain a pdf using curl: &lt;pre&gt;curl -XPOST [URL] &gt; document.pdf&lt;/pre&gt;
188
150
  # @param token Authentication credential
189
151
  # @param id Order id
190
152
  # @param type Type of invoice
191
153
  # @param [Hash] opts the optional parameters
192
- # @return [nil]
193
- describe 'api_v1_orders_invoice test' do
194
- it "should work" do
195
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
196
- end
154
+ # @return [File]
155
+ describe 'orders_invoice test' do
156
+ it 'should work'
197
157
  end
198
158
 
199
- # unit tests for api_v1_orders_order_details
159
+ # unit tests for orders_order_details
200
160
  # Generate an order details pdf
201
161
  # Here is an example of how to obtain a pdf using curl: &lt;pre&gt;curl -XPOST [URL] &gt; document.pdf&lt;/pre&gt;
202
162
  # @param token Authentication credential
203
163
  # @param id Order id
204
164
  # @param [Hash] opts the optional parameters
205
- # @return [nil]
206
- describe 'api_v1_orders_order_details test' do
207
- it "should work" do
208
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
209
- end
165
+ # @return [File]
166
+ describe 'orders_order_details test' do
167
+ it 'should work'
210
168
  end
211
169
 
212
- # unit tests for api_v1_orders_order_details_bulk
170
+ # unit tests for orders_order_details_bulk
213
171
  # Generate pdf with order details for each order
214
172
  # &lt;p/&gt; Here is an example of how to obtain a pdf using curl: &lt;pre&gt;curl -H \&quot;Content-Type: application/json\&quot; -d &#39;[{\&quot;id\&quot;: 123}, {\&quot;id\&quot;: 456}]&#39; -XPOST [URL] &gt; document.pdf&lt;/pre&gt;&lt;p/&gt; Ensure that the Content-Type header is set to \&quot;Content-Type: application/json\&quot;.&lt;p/&gt;
215
173
  # @param token Authentication credential
216
- # @param
174
+ # @param payload
217
175
  # @param [Hash] opts the optional parameters
218
- # @return [nil]
219
- describe 'api_v1_orders_order_details_bulk test' do
220
- it "should work" do
221
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
222
- end
176
+ # @return [File]
177
+ describe 'orders_order_details_bulk test' do
178
+ it 'should work'
223
179
  end
224
180
 
225
- # unit tests for api_v1_orders_show
181
+ # unit tests for orders_show
226
182
  # Fetch a single Order
227
183
  #
228
184
  # @param token Authentication credential
@@ -230,10 +186,8 @@ describe 'OrdersApi' do
230
186
  # @param [Hash] opts the optional parameters
231
187
  # @option opts [String] :include Comma separated list of nodes to expand. Currently the available values are: &lt;br /&gt;&lt;b style&#x3D;\&quot;margin-left: 10px\&quot;&gt;financials&lt;/b&gt; &lt;p style&#x3D;\&quot;margin-left: 20px\&quot;&gt; Additional financial data about this order, eg: commission and discount amounts. &lt;/p&gt;
232
188
  # @return [Order]
233
- describe 'api_v1_orders_show test' do
234
- it "should work" do
235
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
236
- end
189
+ describe 'orders_show test' do
190
+ it 'should work'
237
191
  end
238
192
 
239
193
  end
@@ -1,38 +1,18 @@
1
- =begin
2
- #Noths
3
-
4
- #www.notonthehighstreet.com API client
5
-
6
- OpenAPI spec version: 1.0
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
12
-
13
- require 'spec_helper'
14
- require 'json'
1
+ # frozen_string_literal: true
15
2
 
16
3
  # Unit tests for Noths::RefundsApi
17
4
  # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
18
5
  # Please update as you see appropriate
19
6
  describe 'RefundsApi' do
20
- before do
21
- # run before each test
22
- @instance = Noths::RefundsApi.new
23
- end
24
-
25
- after do
26
- # run after each test
27
- end
7
+ let(:instance) { Noths::RefundsApi.new }
28
8
 
29
9
  describe 'test an instance of RefundsApi' do
30
10
  it 'should create an instance of RefundsApi' do
31
- expect(@instance).to be_instance_of(Noths::RefundsApi)
11
+ expect(instance).to be_instance_of(Noths::RefundsApi)
32
12
  end
33
13
  end
34
14
 
35
- # unit tests for api_v1_refunds_create
15
+ # unit tests for refunds_create
36
16
  # Refund an order
37
17
  # Refunds all or part of an order
38
18
  # @param token Authentication credential
@@ -41,10 +21,8 @@ describe 'RefundsApi' do
41
21
  # @param cents
42
22
  # @param [Hash] opts the optional parameters
43
23
  # @return [RefundResponse]
44
- describe 'api_v1_refunds_create test' do
45
- it "should work" do
46
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
47
- end
24
+ describe 'refunds_create test' do
25
+ it 'should work'
48
26
  end
49
27
 
50
28
  end
@@ -1,16 +1,4 @@
1
- =begin
2
- #Noths
3
-
4
- #www.notonthehighstreet.com API client
5
-
6
- OpenAPI spec version: 1.0
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
12
-
13
- require 'spec_helper'
1
+ # frozen_string_literal: true
14
2
 
15
3
  describe Noths::ApiClient do
16
4
  context 'initialization' do
@@ -124,7 +112,7 @@ describe Noths::ApiClient do
124
112
  #api_client = Noths::ApiClient.new
125
113
  #_model = Noths::ModelName.new
126
114
  # update the model attribute below
127
- #_model.id = 1
115
+ #_model.id = 1
128
116
  # update the expected value (hash) below
129
117
  #expected = {id: 1, name: '', tags: []}
130
118
  #expect(api_client.object_to_hash(_model)).to eq(expected)
@@ -1,41 +1,25 @@
1
- =begin
2
- #Noths
3
-
4
- #www.notonthehighstreet.com API client
5
-
6
- OpenAPI spec version: 1.0
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
12
-
13
- require 'spec_helper'
1
+ # frozen_string_literal: true
14
2
 
15
3
  describe Noths::Configuration do
16
4
  let(:config) { Noths::Configuration.default }
17
5
 
18
- before(:each) do
19
- # uncomment below to setup host and base_path
20
- #require 'URI'
21
- #uri = URI.parse("http://localhost")
22
- #Noths.configure do |c|
23
- # c.host = uri.host
24
- # c.base_path = uri.path
25
- #end
6
+ before do
7
+ Noths.configure do |c|
8
+ c.scheme = 'https'
9
+ c.host = 'api.example.com'
10
+ c.base_path = '/v1'
11
+ end
26
12
  end
27
13
 
28
14
  describe '#base_url' do
29
15
  it 'should have the default value' do
30
- # uncomment below to test default value of the base path
31
- #expect(config.base_url).to eq("http://localhost")
16
+ expect(config.base_url).to eq("https://api.example.com/v1")
32
17
  end
33
18
 
34
19
  it 'should remove trailing slashes' do
35
20
  [nil, '', '/', '//'].each do |base_path|
36
21
  config.base_path = base_path
37
- # uncomment below to test trailing slashes
38
- #expect(config.base_url).to eq("http://localhost")
22
+ expect(config.base_url).to eq("https://api.example.com")
39
23
  end
40
24
  end
41
25
  end
@@ -1,59 +1,28 @@
1
- =begin
2
- #Noths
3
-
4
- #www.notonthehighstreet.com API client
5
-
6
- OpenAPI spec version: 1.0
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
12
-
13
- require 'spec_helper'
14
- require 'json'
15
- require 'date'
1
+ # frozen_string_literal: true
16
2
 
17
3
  # Unit tests for Noths::AcceptanceBulkModel
18
- # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
- # Please update as you see appropriate
20
4
  describe 'AcceptanceBulkModel' do
21
- before do
22
- # run before each test
23
- @instance = Noths::AcceptanceBulkModel.new
24
- end
25
-
26
- after do
27
- # run after each test
28
- end
5
+ let(:instance) { Noths::AcceptanceBulkModel.new }
29
6
 
30
7
  describe 'test an instance of AcceptanceBulkModel' do
31
8
  it 'should create an instance of AcceptanceBulkModel' do
32
- expect(@instance).to be_instance_of(Noths::AcceptanceBulkModel)
9
+ expect(instance).to be_instance_of(Noths::AcceptanceBulkModel)
33
10
  end
34
11
  end
35
12
  describe 'test attribute "id"' do
36
- it 'should work' do
37
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
- end
13
+ it 'should work'
39
14
  end
40
15
 
41
16
  describe 'test attribute "estimated_delivery_date"' do
42
- it 'should work' do
43
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
- end
17
+ it 'should work'
45
18
  end
46
19
 
47
20
  describe 'test attribute "estimated_dispatch_at"' do
48
- it 'should work' do
49
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
- end
21
+ it 'should work'
51
22
  end
52
23
 
53
24
  describe 'test attribute "confirmation_note"' do
54
- it 'should work' do
55
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
- end
25
+ it 'should work'
57
26
  end
58
27
 
59
28
  end