maturate 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0217d9cb4e435fcc946b5812927a936cf627a423
4
- data.tar.gz: dc914d27bf2584f8ed305072d9129ddd3af6cfe2
3
+ metadata.gz: 79546f718b35e4de99620e2462d15102aee704d7
4
+ data.tar.gz: 90c24c831990bfc899c71af4cc31a4d9990d737a
5
5
  SHA512:
6
- metadata.gz: 0baff55db5ab9bb56cec2476865830ed8f15c0e4f3e1f505c88fc3d725fccfdf5d78bc50f99951c63c15a2814b1d1242db08561b8ff46524413759d20909814d
7
- data.tar.gz: 777e7f41bdba697da8f498cab1473bbce2a972765f08a8da614b58c72b5981d42483bddf43c7272b5a766ce4b4ef7acd8ef30a173afc1082c387f79d551ed924
6
+ metadata.gz: 9dd74d51b9a293a96ae7fa717fc09af7b4ebaca72dd22855d151d4db0688bc60ad788221330a58c02836bbff6c1d81a04953342a26d90709fc87dd1b5db5e2cc
7
+ data.tar.gz: 1a8383e8374d8dc238df4e072c1ee73daaa9f955cda60d2924cb19b4611683ba30b45a928732c5200cb6e7083ce5d725fbd229f0c2eed2391b7a99217a56e08f
data/README.md CHANGED
@@ -1,3 +1,9 @@
1
1
  # Maturate
2
2
 
3
3
  Naturally grow your rails API through sane versioning.
4
+
5
+ #### Flow
6
+
7
+ docker build --tag=maturate .
8
+ docker run -it --rm -v $PWD:/usr/src/app maturate rake
9
+ docker run -it --rm -v $PWD:/usr/src/app maturate gem build maturate.gemspec
data/lib/maturate.rb CHANGED
@@ -148,31 +148,31 @@ module Maturate
148
148
  setup_request_handling kls
149
149
  end
150
150
 
151
- def api_versions= ary
152
- @@api_versions = ary
153
- end
154
-
155
151
  def current_api_version= str
156
- unless @@api_versions.include?(str)
152
+ unless api_versions.include?(str)
157
153
  msg = "#{str} is not a known version. Known: #{api_versions}. " +
158
154
  "Use `self.api_versions = [...]` to set known versions."
159
155
  raise InvalidVersion, msg
160
156
  end
161
- @@current_api_version =
157
+ self._current_api_version = str
158
+ end
159
+
160
+ def skip_versioned_url_generation opts={}
161
+ prepend_before_action :skip_versioned_url_generation, opts
162
162
  end
163
163
 
164
164
  private
165
165
 
166
- def self.setup_api_versioning
167
- kls.send :mattr_reader, :api_versions
166
+ def self.setup_api_versioning kls
167
+ kls.send :mattr_accessor, :api_versions, instance_accessor: false
168
168
  @@api_versions = []
169
- kls.send :mattr_reader, :current_api_version
170
- helper_method :api_version
169
+ kls.send :mattr_accessor, :_current_api_version, instance_accessor: false
170
+ kls.helper_method :api_version
171
171
  end
172
172
 
173
173
  def self.setup_request_handling kls
174
174
  kls.before_action :set_api_version_variant
175
- kls.before_action :set_api_default_url_param
175
+ kls.before_action :set_api_version_default_url_param
176
176
  kls.after_action :reset_url_versioning
177
177
  end
178
178
 
@@ -203,6 +203,10 @@ module Maturate
203
203
  @_skip_versioned_url_generation = true
204
204
  end
205
205
 
206
+ def current_api_version
207
+ self.class._current_api_version || api_versions.last
208
+ end
209
+
206
210
  private
207
211
 
208
212
  def set_api_version_variant
@@ -2,4 +2,7 @@ class ApplicationController < ActionController::Base
2
2
  # Prevent CSRF attacks by raising an exception.
3
3
  # For APIs, you may want to use :null_session instead.
4
4
  protect_from_forgery with: :exception
5
+
6
+ extend Maturate
7
+ self.api_versions = ['v1', 'v2']
5
8
  end
@@ -0,0 +1,11 @@
1
+ class HumansController < ApplicationController
2
+ skip_versioned_url_generation only: [:index2]
3
+
4
+ def index
5
+ render text: 'OK', location: humans_path
6
+ end
7
+
8
+ def index2
9
+ render text: 'FINE', location: benefits_packages_path
10
+ end
11
+ end
@@ -1,6 +1,7 @@
1
1
  require File.expand_path('../boot', __FILE__)
2
2
 
3
- require 'rails/all'
3
+ # require 'rails/all'
4
+ require "action_controller/railtie"
4
5
 
5
6
  Bundler.require(*Rails.groups)
6
7
  require "maturate"
@@ -20,7 +21,7 @@ module Dummy
20
21
  # config.i18n.default_locale = :de
21
22
 
22
23
  # Do not swallow errors in after_commit/after_rollback callbacks.
23
- config.active_record.raise_in_transactional_callbacks = true
24
+ # config.active_record.raise_in_transactional_callbacks = true
24
25
  end
25
26
  end
26
27
 
@@ -29,7 +29,7 @@ Rails.application.configure do
29
29
  # Tell Action Mailer not to deliver emails to the real world.
30
30
  # The :test delivery method accumulates sent emails in the
31
31
  # ActionMailer::Base.deliveries array.
32
- config.action_mailer.delivery_method = :test
32
+ # config.action_mailer.delivery_method = :test
33
33
 
34
34
  # Randomize the order test cases are executed.
35
35
  config.active_support.test_order = :random
@@ -1,56 +1,14 @@
1
1
  Rails.application.routes.draw do
2
- # The priority is based upon order of creation: first created -> highest priority.
3
- # See how all your routes lay out with "rake routes".
4
-
5
- # You can have the root of your site routed with "root"
6
- # root 'welcome#index'
7
-
8
- # Example of regular route:
9
- # get 'products/:id' => 'catalog#view'
10
-
11
- # Example of named route that can be invoked with purchase_url(id: product.id)
12
- # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
13
-
14
- # Example resource route (maps HTTP verbs to controller actions automatically):
15
- # resources :products
16
-
17
- # Example resource route with options:
18
- # resources :products do
19
- # member do
20
- # get 'short'
21
- # post 'toggle'
22
- # end
23
- #
24
- # collection do
25
- # get 'sold'
26
- # end
27
- # end
28
-
29
- # Example resource route with sub-resources:
30
- # resources :products do
31
- # resources :comments, :sales
32
- # resource :seller
33
- # end
34
-
35
- # Example resource route with more complex sub-resources:
36
- # resources :products do
37
- # resources :comments
38
- # resources :sales do
39
- # get 'recent', on: :collection
40
- # end
41
- # end
42
-
43
- # Example resource route with concerns:
44
- # concern :toggleable do
45
- # post 'toggle'
46
- # end
47
- # resources :posts, concerns: :toggleable
48
- # resources :photos, concerns: :toggleable
49
-
50
- # Example resource route within a namespace:
51
- # namespace :admin do
52
- # # Directs /admin/products/* to Admin::ProductsController
53
- # # (app/controllers/admin/products_controller.rb)
54
- # resources :products
55
- # end
2
+ scope '/api' do
3
+ scope '/:api_version' do
4
+ resources :humans do
5
+ collection do
6
+ get :index2
7
+ end
8
+ end
9
+ end
10
+ end
11
+ scope '/not-api' do
12
+ resources :benefits_packages
13
+ end
56
14
  end
File without changes
@@ -0,0 +1,777 @@
1
+  (0.1ms) begin transaction
2
+ ------------------------
3
+ MaturateTest: test_truth
4
+ ------------------------
5
+  (0.1ms) rollback transaction
6
+  (0.1ms) begin transaction
7
+ ----------------------------------------------------
8
+ MaturateTest: test_can_set_api_version_on_controller
9
+ ----------------------------------------------------
10
+  (0.1ms) rollback transaction
11
+  (0.1ms) begin transaction
12
+ ----------------------------------------------------
13
+ MaturateTest: test_can_set_api_version_on_controller
14
+ ----------------------------------------------------
15
+  (0.1ms) rollback transaction
16
+  (0.2ms) begin transaction
17
+ ----------------------------------------------------
18
+ MaturateTest: test_can_set_api_version_on_controller
19
+ ----------------------------------------------------
20
+  (0.1ms) rollback transaction
21
+  (0.1ms) begin transaction
22
+ ----------------------------------------------------
23
+ MaturateTest: test_can_set_api_version_on_controller
24
+ ----------------------------------------------------
25
+  (0.1ms) rollback transaction
26
+  (0.1ms) begin transaction
27
+ -----------------------------------------------------------------
28
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
29
+ -----------------------------------------------------------------
30
+  (0.1ms) rollback transaction
31
+  (0.1ms) begin transaction
32
+ -----------------------------------------------------------------------
33
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
34
+ -----------------------------------------------------------------------
35
+  (0.1ms) rollback transaction
36
+  (0.1ms) begin transaction
37
+ ----------------------------------------------------
38
+ MaturateTest: test_can_set_api_version_on_controller
39
+ ----------------------------------------------------
40
+  (0.1ms) rollback transaction
41
+  (0.1ms) begin transaction
42
+ -----------------------------------------------------------------
43
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
44
+ -----------------------------------------------------------------
45
+  (0.1ms) rollback transaction
46
+  (0.1ms) begin transaction
47
+ -----------------------------------------------------------------------
48
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
49
+ -----------------------------------------------------------------------
50
+  (0.2ms) rollback transaction
51
+ ----------------------------------------------------
52
+ MaturateRequestTest: test_api_version_set_by_request
53
+ ----------------------------------------------------
54
+ ----------------------------------------------------
55
+ MaturateTest: test_can_set_api_version_on_controller
56
+ ----------------------------------------------------
57
+ -----------------------------------------------------------------
58
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
59
+ -----------------------------------------------------------------
60
+ -----------------------------------------------------------------------
61
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
62
+ -----------------------------------------------------------------------
63
+ -----------------------------------------------------------------
64
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
65
+ -----------------------------------------------------------------
66
+ ----------------------------------------------------
67
+ MaturateTest: test_can_set_api_version_on_controller
68
+ ----------------------------------------------------
69
+ -----------------------------------------------------------------------
70
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
71
+ -----------------------------------------------------------------------
72
+ ----------------------------------------------------
73
+ MaturateRequestTest: test_api_version_set_by_request
74
+ ----------------------------------------------------
75
+ Processing by HumansController#index as HTML
76
+ Parameters: {"api_version"=>"v1"}
77
+ Completed 500 Internal Server Error in 0ms
78
+ -----------------------------------------------------------------------
79
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
80
+ -----------------------------------------------------------------------
81
+ ----------------------------------------------------
82
+ MaturateTest: test_can_set_api_version_on_controller
83
+ ----------------------------------------------------
84
+ -----------------------------------------------------------------
85
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
86
+ -----------------------------------------------------------------
87
+ ----------------------------------------------------
88
+ MaturateRequestTest: test_api_version_set_by_request
89
+ ----------------------------------------------------
90
+ Processing by HumansController#index as HTML
91
+ Parameters: {"api_version"=>"v1"}
92
+ Completed 500 Internal Server Error in 0ms
93
+ ----------------------------------------------------
94
+ MaturateRequestTest: test_api_version_set_by_request
95
+ ----------------------------------------------------
96
+ Processing by HumansController#index as HTML
97
+ Parameters: {"api_version"=>"v1"}
98
+ Completed 500 Internal Server Error in 0ms
99
+ -----------------------------------------------------------------------
100
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
101
+ -----------------------------------------------------------------------
102
+ -----------------------------------------------------------------
103
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
104
+ -----------------------------------------------------------------
105
+ --------------------------------------------
106
+ MaturateTest: test_api_versions_are_readable
107
+ --------------------------------------------
108
+ ----------------------------------------------------
109
+ MaturateTest: test_can_set_api_version_on_controller
110
+ ----------------------------------------------------
111
+ ----------------------------------------------------
112
+ MaturateRequestTest: test_api_version_set_by_request
113
+ ----------------------------------------------------
114
+ Processing by HumansController#index as HTML
115
+ Parameters: {"api_version"=>"v1"}
116
+ Completed 500 Internal Server Error in 0ms
117
+ ----------------------------------------------------
118
+ MaturateTest: test_can_set_api_version_on_controller
119
+ ----------------------------------------------------
120
+ --------------------------------------------
121
+ MaturateTest: test_api_versions_are_readable
122
+ --------------------------------------------
123
+ -----------------------------------------------------------------
124
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
125
+ -----------------------------------------------------------------
126
+ -----------------------------------------------------------------------
127
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
128
+ -----------------------------------------------------------------------
129
+ ----------------------------------------------------
130
+ MaturateRequestTest: test_api_version_set_by_request
131
+ ----------------------------------------------------
132
+ Processing by HumansController#index as HTML
133
+ Parameters: {"api_version"=>"v1"}
134
+ Completed 500 Internal Server Error in 0ms
135
+ -----------------------------------------------------------------------
136
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
137
+ -----------------------------------------------------------------------
138
+ ----------------------------------------------------
139
+ MaturateTest: test_can_set_api_version_on_controller
140
+ ----------------------------------------------------
141
+ -----------------------------------------------------------------
142
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
143
+ -----------------------------------------------------------------
144
+ --------------------------------------------
145
+ MaturateTest: test_api_versions_are_readable
146
+ --------------------------------------------
147
+ ----------------------------------------------------
148
+ MaturateRequestTest: test_api_version_set_by_request
149
+ ----------------------------------------------------
150
+ Processing by HumansController#index as HTML
151
+ Parameters: {"api_version"=>"v1"}
152
+ Completed 500 Internal Server Error in 0ms
153
+ -----------------------------------------------------------------------
154
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
155
+ -----------------------------------------------------------------------
156
+ --------------------------------------------
157
+ MaturateTest: test_api_versions_are_readable
158
+ --------------------------------------------
159
+ ----------------------------------------------------
160
+ MaturateTest: test_can_set_api_version_on_controller
161
+ ----------------------------------------------------
162
+ -----------------------------------------------------------------
163
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
164
+ -----------------------------------------------------------------
165
+ --------------------------------------------
166
+ MaturateTest: test_api_versions_are_readable
167
+ --------------------------------------------
168
+ -----------------------------------------------------------------
169
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
170
+ -----------------------------------------------------------------
171
+ -----------------------------------------------------------------------
172
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
173
+ -----------------------------------------------------------------------
174
+ ----------------------------------------------------
175
+ MaturateTest: test_can_set_api_version_on_controller
176
+ ----------------------------------------------------
177
+ ----------------------------------------------------
178
+ MaturateRequestTest: test_api_version_set_by_request
179
+ ----------------------------------------------------
180
+ Processing by HumansController#index as HTML
181
+ Parameters: {"api_version"=>"v1"}
182
+ Completed 500 Internal Server Error in 1ms
183
+ ----------------------------------------------------
184
+ MaturateTest: test_can_set_api_version_on_controller
185
+ ----------------------------------------------------
186
+ -----------------------------------------------------------------------
187
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
188
+ -----------------------------------------------------------------------
189
+ --------------------------------------------
190
+ MaturateTest: test_api_versions_are_readable
191
+ --------------------------------------------
192
+ -----------------------------------------------------------------
193
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
194
+ -----------------------------------------------------------------
195
+ ----------------------------------------------------
196
+ MaturateRequestTest: test_api_version_set_by_request
197
+ ----------------------------------------------------
198
+ Processing by HumansController#index as HTML
199
+ Parameters: {"api_version"=>"v1"}
200
+ Completed 500 Internal Server Error in 1ms
201
+ ----------------------------------------------------
202
+ MaturateRequestTest: test_api_version_set_by_request
203
+ ----------------------------------------------------
204
+ Processing by HumansController#index as HTML
205
+ Parameters: {"api_version"=>"v1"}
206
+ Rendered text template (0.0ms)
207
+ Completed 200 OK in 24ms (Views: 23.8ms)
208
+ --------------------------------------------
209
+ MaturateTest: test_api_versions_are_readable
210
+ --------------------------------------------
211
+ ----------------------------------------------------
212
+ MaturateTest: test_can_set_api_version_on_controller
213
+ ----------------------------------------------------
214
+ -----------------------------------------------------------------
215
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
216
+ -----------------------------------------------------------------
217
+ -----------------------------------------------------------------------
218
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
219
+ -----------------------------------------------------------------------
220
+ -----------------------------------------------------------------------
221
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
222
+ -----------------------------------------------------------------------
223
+ --------------------------------------------
224
+ MaturateTest: test_api_versions_are_readable
225
+ --------------------------------------------
226
+ -----------------------------------------------------------------
227
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
228
+ -----------------------------------------------------------------
229
+ ----------------------------------------------------
230
+ MaturateTest: test_can_set_api_version_on_controller
231
+ ----------------------------------------------------
232
+ ----------------------------------------------------
233
+ MaturateRequestTest: test_api_version_set_by_request
234
+ ----------------------------------------------------
235
+ Processing by HumansController#index as HTML
236
+ Parameters: {"api_version"=>"v1"}
237
+ Rendered text template (0.0ms)
238
+ Completed 200 OK in 29ms (Views: 28.3ms)
239
+ --------------------------------------------------------
240
+ MaturateRequestTest: test_unknown_version_maps_to_latest
241
+ --------------------------------------------------------
242
+ Processing by HumansController#index as HTML
243
+ Parameters: {"api_version"=>"?????????"}
244
+ Rendered text template (0.0ms)
245
+ Completed 200 OK in 24ms (Views: 23.9ms)
246
+ ----------------------------------------------------
247
+ MaturateRequestTest: test_api_version_set_by_request
248
+ ----------------------------------------------------
249
+ Processing by HumansController#index as HTML
250
+ Parameters: {"api_version"=>"v1"}
251
+ Rendered text template (0.0ms)
252
+ Completed 200 OK in 1ms (Views: 0.4ms)
253
+ -----------------------------------------------------------------
254
+ MaturateRequestTest: test_current_symbolic-version_maps_to_latest
255
+ -----------------------------------------------------------------
256
+ Processing by HumansController#index as HTML
257
+ Parameters: {"api_version"=>"curent"}
258
+ Rendered text template (0.0ms)
259
+ Completed 200 OK in 1ms (Views: 0.4ms)
260
+ -----------------------------------------------------------------
261
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
262
+ -----------------------------------------------------------------
263
+ -----------------------------------------------------------------------
264
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
265
+ -----------------------------------------------------------------------
266
+ --------------------------------------------
267
+ MaturateTest: test_api_versions_are_readable
268
+ --------------------------------------------
269
+ ----------------------------------------------------
270
+ MaturateTest: test_can_set_api_version_on_controller
271
+ ----------------------------------------------------
272
+ ---------------------------------------------------------------------------
273
+ CustomCurrentVersionControllerTest: test_latest_version_can_be_set_manually
274
+ ---------------------------------------------------------------------------
275
+ -----------------------------------------------------------------
276
+ MaturateRequestTest: test_current_symbolic-version_maps_to_latest
277
+ -----------------------------------------------------------------
278
+ Processing by HumansController#index as HTML
279
+ Parameters: {"api_version"=>"curent"}
280
+ Rendered text template (0.1ms)
281
+ Completed 200 OK in 26ms (Views: 25.3ms)
282
+ --------------------------------------------------------
283
+ MaturateRequestTest: test_unknown_version_maps_to_latest
284
+ --------------------------------------------------------
285
+ Processing by HumansController#index as HTML
286
+ Parameters: {"api_version"=>"?????????"}
287
+ Rendered text template (0.0ms)
288
+ Completed 200 OK in 1ms (Views: 0.6ms)
289
+ ----------------------------------------------------
290
+ MaturateRequestTest: test_api_version_set_by_request
291
+ ----------------------------------------------------
292
+ Processing by HumansController#index as HTML
293
+ Parameters: {"api_version"=>"v1"}
294
+ Rendered text template (0.0ms)
295
+ Completed 200 OK in 1ms (Views: 0.4ms)
296
+ ------------------------------------------------------------
297
+ MaturateRequestTest: test_latest_version_can_be_set_manually
298
+ ------------------------------------------------------------
299
+ Processing by HumansController#index as HTML
300
+ Parameters: {"api_version"=>"current"}
301
+ Rendered text template (0.0ms)
302
+ Completed 200 OK in 1ms (Views: 0.4ms)
303
+ -----------------------------------------------------------------------
304
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
305
+ -----------------------------------------------------------------------
306
+ ----------------------------------------------------
307
+ MaturateTest: test_can_set_api_version_on_controller
308
+ ----------------------------------------------------
309
+ -----------------------------------------------------------------
310
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
311
+ -----------------------------------------------------------------
312
+ --------------------------------------------
313
+ MaturateTest: test_api_versions_are_readable
314
+ --------------------------------------------
315
+ --------------------------------------------
316
+ MaturateTest: test_api_versions_are_readable
317
+ --------------------------------------------
318
+ ----------------------------------------------------
319
+ MaturateTest: test_can_set_api_version_on_controller
320
+ ----------------------------------------------------
321
+ -----------------------------------------------------------------
322
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
323
+ -----------------------------------------------------------------
324
+ -----------------------------------------------------------------------
325
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
326
+ -----------------------------------------------------------------------
327
+ ------------------------------------------------------------
328
+ MaturateRequestTest: test_latest_version_can_be_set_manually
329
+ ------------------------------------------------------------
330
+ Processing by HumansController#index as HTML
331
+ Parameters: {"api_version"=>"current"}
332
+ Rendered text template (0.0ms)
333
+ Completed 200 OK in 31ms (Views: 30.7ms)
334
+ --------------------------------------------------------
335
+ MaturateRequestTest: test_unknown_version_maps_to_latest
336
+ --------------------------------------------------------
337
+ Processing by HumansController#index as HTML
338
+ Parameters: {"api_version"=>"?????????"}
339
+ Rendered text template (0.0ms)
340
+ Completed 200 OK in 1ms (Views: 0.5ms)
341
+ ----------------------------------------------------
342
+ MaturateRequestTest: test_api_version_set_by_request
343
+ ----------------------------------------------------
344
+ Processing by HumansController#index as HTML
345
+ Parameters: {"api_version"=>"v1"}
346
+ Rendered text template (0.0ms)
347
+ Completed 200 OK in 1ms (Views: 0.4ms)
348
+ ------------------------------------------------------------------------
349
+ MaturateRequestTest: test_url_generation_includes_api_version_by_default
350
+ ------------------------------------------------------------------------
351
+ -----------------------------------------------------------------
352
+ MaturateRequestTest: test_current_symbolic-version_maps_to_latest
353
+ -----------------------------------------------------------------
354
+ Processing by HumansController#index as HTML
355
+ Parameters: {"api_version"=>"curent"}
356
+ Rendered text template (0.0ms)
357
+ Completed 200 OK in 1ms (Views: 0.5ms)
358
+ ------------------------------------------------------------------------
359
+ MaturateRequestTest: test_url_generation_includes_api_version_by_default
360
+ ------------------------------------------------------------------------
361
+ Processing by HumansController#index as HTML
362
+ Parameters: {"api_version"=>"v1"}
363
+ Rendered text template (0.0ms)
364
+ Completed 200 OK in 25ms (Views: 25.0ms)
365
+ -----------------------------------------------------------------
366
+ MaturateRequestTest: test_current_symbolic-version_maps_to_latest
367
+ -----------------------------------------------------------------
368
+ Processing by HumansController#index as HTML
369
+ Parameters: {"api_version"=>"curent"}
370
+ Rendered text template (0.0ms)
371
+ Completed 200 OK in 1ms (Views: 0.5ms)
372
+ ----------------------------------------------------
373
+ MaturateRequestTest: test_api_version_set_by_request
374
+ ----------------------------------------------------
375
+ Processing by HumansController#index as HTML
376
+ Parameters: {"api_version"=>"v1"}
377
+ Rendered text template (0.0ms)
378
+ Completed 200 OK in 1ms (Views: 0.8ms)
379
+ ------------------------------------------------------------
380
+ MaturateRequestTest: test_latest_version_can_be_set_manually
381
+ ------------------------------------------------------------
382
+ Processing by HumansController#index as HTML
383
+ Parameters: {"api_version"=>"current"}
384
+ Rendered text template (0.0ms)
385
+ Completed 200 OK in 1ms (Views: 0.6ms)
386
+ --------------------------------------------------------
387
+ MaturateRequestTest: test_unknown_version_maps_to_latest
388
+ --------------------------------------------------------
389
+ Processing by HumansController#index as HTML
390
+ Parameters: {"api_version"=>"?????????"}
391
+ Rendered text template (0.0ms)
392
+ Completed 200 OK in 2ms (Views: 1.1ms)
393
+ --------------------------------------------
394
+ MaturateTest: test_api_versions_are_readable
395
+ --------------------------------------------
396
+ -----------------------------------------------------------------
397
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
398
+ -----------------------------------------------------------------
399
+ -----------------------------------------------------------------------
400
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
401
+ -----------------------------------------------------------------------
402
+ ----------------------------------------------------
403
+ MaturateTest: test_can_set_api_version_on_controller
404
+ ----------------------------------------------------
405
+ --------------------------------------------
406
+ MaturateTest: test_api_versions_are_readable
407
+ --------------------------------------------
408
+ ----------------------------------------------------
409
+ MaturateTest: test_can_set_api_version_on_controller
410
+ ----------------------------------------------------
411
+ -----------------------------------------------------------------
412
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
413
+ -----------------------------------------------------------------
414
+ -----------------------------------------------------------------------
415
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
416
+ -----------------------------------------------------------------------
417
+ ----------------------------------------------------
418
+ MaturateRequestTest: test_api_version_set_by_request
419
+ ----------------------------------------------------
420
+ Processing by HumansController#index as HTML
421
+ Parameters: {"api_version"=>"v1"}
422
+ Rendered text template (0.0ms)
423
+ Completed 200 OK in 29ms (Views: 28.7ms)
424
+ ------------------------------------------------------------------------
425
+ MaturateRequestTest: test_url_generation_includes_api_version_by_default
426
+ ------------------------------------------------------------------------
427
+ Processing by HumansController#index as HTML
428
+ Parameters: {"api_version"=>"v1"}
429
+ Rendered text template (0.0ms)
430
+ Completed 200 OK in 1ms (Views: 0.5ms)
431
+ --------------------------------------------------------
432
+ MaturateRequestTest: test_unknown_version_maps_to_latest
433
+ --------------------------------------------------------
434
+ Processing by HumansController#index as HTML
435
+ Parameters: {"api_version"=>"?????????"}
436
+ Rendered text template (0.0ms)
437
+ Completed 200 OK in 1ms (Views: 0.4ms)
438
+ -----------------------------------------------------------
439
+ MaturateRequestTest: test_url_version_param_can_be_disabled
440
+ -----------------------------------------------------------
441
+ -----------------------------------------------------------------
442
+ MaturateRequestTest: test_current_symbolic-version_maps_to_latest
443
+ -----------------------------------------------------------------
444
+ Processing by HumansController#index as HTML
445
+ Parameters: {"api_version"=>"curent"}
446
+ Rendered text template (0.0ms)
447
+ Completed 200 OK in 1ms (Views: 0.5ms)
448
+ ------------------------------------------------------------
449
+ MaturateRequestTest: test_latest_version_can_be_set_manually
450
+ ------------------------------------------------------------
451
+ Processing by HumansController#index as HTML
452
+ Parameters: {"api_version"=>"current"}
453
+ Rendered text template (0.0ms)
454
+ Completed 200 OK in 1ms (Views: 0.3ms)
455
+ ------------------------------------------------------------
456
+ MaturateRequestTest: test_latest_version_can_be_set_manually
457
+ ------------------------------------------------------------
458
+ Processing by HumansController#index as HTML
459
+ Parameters: {"api_version"=>"current"}
460
+ Rendered text template (0.0ms)
461
+ Completed 200 OK in 26ms (Views: 25.4ms)
462
+ ------------------------------------------------------------------------
463
+ MaturateRequestTest: test_url_generation_includes_api_version_by_default
464
+ ------------------------------------------------------------------------
465
+ Processing by HumansController#index as HTML
466
+ Parameters: {"api_version"=>"v1"}
467
+ Rendered text template (0.0ms)
468
+ Completed 200 OK in 1ms (Views: 0.5ms)
469
+ -----------------------------------------------------------
470
+ MaturateRequestTest: test_url_version_param_can_be_disabled
471
+ -----------------------------------------------------------
472
+ Processing by HumansController#index2 as HTML
473
+ Parameters: {"api_version"=>"v1"}
474
+ Completed 500 Internal Server Error in 2ms
475
+ --------------------------------------------------------
476
+ MaturateRequestTest: test_unknown_version_maps_to_latest
477
+ --------------------------------------------------------
478
+ Processing by HumansController#index as HTML
479
+ Parameters: {"api_version"=>"?????????"}
480
+ Rendered text template (0.0ms)
481
+ Completed 200 OK in 1ms (Views: 0.5ms)
482
+ ----------------------------------------------------
483
+ MaturateRequestTest: test_api_version_set_by_request
484
+ ----------------------------------------------------
485
+ Processing by HumansController#index as HTML
486
+ Parameters: {"api_version"=>"v1"}
487
+ Rendered text template (0.0ms)
488
+ Completed 200 OK in 1ms (Views: 0.5ms)
489
+ -----------------------------------------------------------------
490
+ MaturateRequestTest: test_current_symbolic-version_maps_to_latest
491
+ -----------------------------------------------------------------
492
+ Processing by HumansController#index as HTML
493
+ Parameters: {"api_version"=>"curent"}
494
+ Rendered text template (0.0ms)
495
+ Completed 200 OK in 1ms (Views: 0.4ms)
496
+ --------------------------------------------
497
+ MaturateTest: test_api_versions_are_readable
498
+ --------------------------------------------
499
+ ----------------------------------------------------
500
+ MaturateTest: test_can_set_api_version_on_controller
501
+ ----------------------------------------------------
502
+ -----------------------------------------------------------------
503
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
504
+ -----------------------------------------------------------------
505
+ -----------------------------------------------------------------------
506
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
507
+ -----------------------------------------------------------------------
508
+ --------------------------------------------
509
+ MaturateTest: test_api_versions_are_readable
510
+ --------------------------------------------
511
+ ----------------------------------------------------
512
+ MaturateTest: test_can_set_api_version_on_controller
513
+ ----------------------------------------------------
514
+ -----------------------------------------------------------------
515
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
516
+ -----------------------------------------------------------------
517
+ -----------------------------------------------------------------------
518
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
519
+ -----------------------------------------------------------------------
520
+ --------------------------------------------------------
521
+ MaturateRequestTest: test_unknown_version_maps_to_latest
522
+ --------------------------------------------------------
523
+ Processing by HumansController#index as HTML
524
+ Parameters: {"api_version"=>"?????????"}
525
+ Rendered text template (0.0ms)
526
+ Completed 200 OK in 30ms (Views: 29.3ms)
527
+ ------------------------------------------------------------------------
528
+ MaturateRequestTest: test_url_generation_includes_api_version_by_default
529
+ ------------------------------------------------------------------------
530
+ Processing by HumansController#index as HTML
531
+ Parameters: {"api_version"=>"v1"}
532
+ Rendered text template (0.0ms)
533
+ Completed 200 OK in 1ms (Views: 0.4ms)
534
+ ----------------------------------------------------
535
+ MaturateRequestTest: test_api_version_set_by_request
536
+ ----------------------------------------------------
537
+ Processing by HumansController#index as HTML
538
+ Parameters: {"api_version"=>"v1"}
539
+ Rendered text template (0.0ms)
540
+ Completed 200 OK in 1ms (Views: 0.4ms)
541
+ ------------------------------------------------------------
542
+ MaturateRequestTest: test_latest_version_can_be_set_manually
543
+ ------------------------------------------------------------
544
+ Processing by HumansController#index as HTML
545
+ Parameters: {"api_version"=>"current"}
546
+ Rendered text template (0.0ms)
547
+ Completed 200 OK in 1ms (Views: 0.5ms)
548
+ -----------------------------------------------------------------
549
+ MaturateRequestTest: test_current_symbolic-version_maps_to_latest
550
+ -----------------------------------------------------------------
551
+ Processing by HumansController#index as HTML
552
+ Parameters: {"api_version"=>"curent"}
553
+ Rendered text template (0.0ms)
554
+ Completed 200 OK in 1ms (Views: 0.3ms)
555
+ -----------------------------------------------------------
556
+ MaturateRequestTest: test_url_version_param_can_be_disabled
557
+ -----------------------------------------------------------
558
+ Processing by HumansController#index2 as HTML
559
+ Parameters: {"api_version"=>"v1"}
560
+ Rendered text template (0.0ms)
561
+ Completed 200 OK in 1ms (Views: 0.4ms)
562
+ --------------------------------------------
563
+ MaturateTest: test_api_versions_are_readable
564
+ --------------------------------------------
565
+ ----------------------------------------------------
566
+ MaturateTest: test_can_set_api_version_on_controller
567
+ ----------------------------------------------------
568
+ -----------------------------------------------------------------
569
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
570
+ -----------------------------------------------------------------
571
+ -----------------------------------------------------------------------
572
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
573
+ -----------------------------------------------------------------------
574
+ -----------------------------------------------------------
575
+ MaturateRequestTest: test_url_version_param_can_be_disabled
576
+ -----------------------------------------------------------
577
+ Processing by HumansController#index2 as HTML
578
+ Parameters: {"api_version"=>"v1"}
579
+ Rendered text template (0.0ms)
580
+ Completed 200 OK in 31ms (Views: 30.8ms)
581
+ ------------------------------------------------------------
582
+ MaturateRequestTest: test_latest_version_can_be_set_manually
583
+ ------------------------------------------------------------
584
+ Processing by HumansController#index as HTML
585
+ Parameters: {"api_version"=>"current"}
586
+ Rendered text template (0.0ms)
587
+ Completed 200 OK in 1ms (Views: 0.5ms)
588
+ ------------------------------------------------------------------------
589
+ MaturateRequestTest: test_url_generation_includes_api_version_by_default
590
+ ------------------------------------------------------------------------
591
+ Processing by HumansController#index as HTML
592
+ Parameters: {"api_version"=>"v1"}
593
+ Rendered text template (0.0ms)
594
+ Completed 200 OK in 1ms (Views: 0.4ms)
595
+ ----------------------------------------------------
596
+ MaturateRequestTest: test_api_version_set_by_request
597
+ ----------------------------------------------------
598
+ Processing by HumansController#index as HTML
599
+ Parameters: {"api_version"=>"v1"}
600
+ Rendered text template (0.0ms)
601
+ Completed 200 OK in 1ms (Views: 0.5ms)
602
+ -----------------------------------------------------------------
603
+ MaturateRequestTest: test_current_symbolic-version_maps_to_latest
604
+ -----------------------------------------------------------------
605
+ Processing by HumansController#index as HTML
606
+ Parameters: {"api_version"=>"curent"}
607
+ Rendered text template (0.0ms)
608
+ Completed 200 OK in 1ms (Views: 0.4ms)
609
+ --------------------------------------------------------
610
+ MaturateRequestTest: test_unknown_version_maps_to_latest
611
+ --------------------------------------------------------
612
+ Processing by HumansController#index as HTML
613
+ Parameters: {"api_version"=>"?????????"}
614
+ Rendered text template (0.0ms)
615
+ Completed 200 OK in 1ms (Views: 0.4ms)
616
+ -----------------------------------------------------------------------
617
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
618
+ -----------------------------------------------------------------------
619
+ --------------------------------------------
620
+ MaturateTest: test_api_versions_are_readable
621
+ --------------------------------------------
622
+ -----------------------------------------------------------------
623
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
624
+ -----------------------------------------------------------------
625
+ ----------------------------------------------------
626
+ MaturateTest: test_can_set_api_version_on_controller
627
+ ----------------------------------------------------
628
+ --------------------------------------------------------
629
+ MaturateRequestTest: test_unknown_version_maps_to_latest
630
+ --------------------------------------------------------
631
+ Processing by HumansController#index as HTML
632
+ Parameters: {"api_version"=>"?????????"}
633
+ Rendered text template (0.0ms)
634
+ Completed 200 OK in 28ms (Views: 26.4ms)
635
+ -----------------------------------------------------------------
636
+ MaturateRequestTest: test_current_symbolic-version_maps_to_latest
637
+ -----------------------------------------------------------------
638
+ Processing by HumansController#index as HTML
639
+ Parameters: {"api_version"=>"curent"}
640
+ Rendered text template (0.0ms)
641
+ Completed 200 OK in 1ms (Views: 0.5ms)
642
+ ------------------------------------------------------------
643
+ MaturateRequestTest: test_latest_version_can_be_set_manually
644
+ ------------------------------------------------------------
645
+ Processing by HumansController#index as HTML
646
+ Parameters: {"api_version"=>"current"}
647
+ Rendered text template (0.0ms)
648
+ Completed 200 OK in 1ms (Views: 0.5ms)
649
+ ------------------------------------------------------------------------
650
+ MaturateRequestTest: test_url_generation_includes_api_version_by_default
651
+ ------------------------------------------------------------------------
652
+ Processing by HumansController#index as HTML
653
+ Parameters: {"api_version"=>"v1"}
654
+ Rendered text template (0.0ms)
655
+ Completed 200 OK in 3ms (Views: 0.7ms)
656
+ -----------------------------------------------------------
657
+ MaturateRequestTest: test_url_version_param_can_be_disabled
658
+ -----------------------------------------------------------
659
+ Processing by HumansController#index2 as HTML
660
+ Parameters: {"api_version"=>"v1"}
661
+ Rendered text template (0.0ms)
662
+ Completed 200 OK in 2ms (Views: 0.6ms)
663
+ ----------------------------------------------------
664
+ MaturateRequestTest: test_api_version_set_by_request
665
+ ----------------------------------------------------
666
+ Processing by HumansController#index as HTML
667
+ Parameters: {"api_version"=>"v1"}
668
+ Rendered text template (0.0ms)
669
+ Completed 200 OK in 2ms (Views: 0.9ms)
670
+ -----------------------------------------------------------------------
671
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
672
+ -----------------------------------------------------------------------
673
+ -----------------------------------------------------------------
674
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
675
+ -----------------------------------------------------------------
676
+ --------------------------------------------
677
+ MaturateTest: test_api_versions_are_readable
678
+ --------------------------------------------
679
+ ----------------------------------------------------
680
+ MaturateTest: test_can_set_api_version_on_controller
681
+ ----------------------------------------------------
682
+ ------------------------------------------------------------
683
+ MaturateRequestTest: test_latest_version_can_be_set_manually
684
+ ------------------------------------------------------------
685
+ Processing by HumansController#index as HTML
686
+ Parameters: {"api_version"=>"current"}
687
+ Rendered text template (0.0ms)
688
+ Completed 200 OK in 31ms (Views: 29.6ms)
689
+ -----------------------------------------------------------------
690
+ MaturateRequestTest: test_current_symbolic-version_maps_to_latest
691
+ -----------------------------------------------------------------
692
+ Processing by HumansController#index as HTML
693
+ Parameters: {"api_version"=>"curent"}
694
+ Rendered text template (0.0ms)
695
+ Completed 200 OK in 2ms (Views: 0.7ms)
696
+ ------------------------------------------------------------------------
697
+ MaturateRequestTest: test_url_generation_includes_api_version_by_default
698
+ ------------------------------------------------------------------------
699
+ Processing by HumansController#index as HTML
700
+ Parameters: {"api_version"=>"v1"}
701
+ Rendered text template (0.0ms)
702
+ Completed 200 OK in 3ms (Views: 0.6ms)
703
+ ----------------------------------------------------
704
+ MaturateRequestTest: test_api_version_set_by_request
705
+ ----------------------------------------------------
706
+ Processing by HumansController#index as HTML
707
+ Parameters: {"api_version"=>"v1"}
708
+ Rendered text template (0.0ms)
709
+ Completed 200 OK in 2ms (Views: 0.6ms)
710
+ --------------------------------------------------------
711
+ MaturateRequestTest: test_unknown_version_maps_to_latest
712
+ --------------------------------------------------------
713
+ Processing by HumansController#index as HTML
714
+ Parameters: {"api_version"=>"?????????"}
715
+ Rendered text template (0.0ms)
716
+ Completed 200 OK in 1ms (Views: 0.5ms)
717
+ -----------------------------------------------------------
718
+ MaturateRequestTest: test_url_version_param_can_be_disabled
719
+ -----------------------------------------------------------
720
+ Processing by HumansController#index2 as HTML
721
+ Parameters: {"api_version"=>"v1"}
722
+ Rendered text template (0.0ms)
723
+ Completed 200 OK in 2ms (Views: 0.6ms)
724
+ -----------------------------------------------------------------------
725
+ MaturateTest: test_cannot_set_current_api_version_to_an_unknown_version
726
+ -----------------------------------------------------------------------
727
+ --------------------------------------------
728
+ MaturateTest: test_api_versions_are_readable
729
+ --------------------------------------------
730
+ -----------------------------------------------------------------
731
+ MaturateTest: test_can_set_current_api_version_to_a_known_version
732
+ -----------------------------------------------------------------
733
+ ----------------------------------------------------
734
+ MaturateTest: test_can_set_api_version_on_controller
735
+ ----------------------------------------------------
736
+ ------------------------------------------------------------
737
+ MaturateRequestTest: test_latest_version_can_be_set_manually
738
+ ------------------------------------------------------------
739
+ Processing by HumansController#index as HTML
740
+ Parameters: {"api_version"=>"current"}
741
+ Rendered text template (0.0ms)
742
+ Completed 200 OK in 30ms (Views: 29.6ms)
743
+ -----------------------------------------------------------------
744
+ MaturateRequestTest: test_current_symbolic-version_maps_to_latest
745
+ -----------------------------------------------------------------
746
+ Processing by HumansController#index as HTML
747
+ Parameters: {"api_version"=>"curent"}
748
+ Rendered text template (0.0ms)
749
+ Completed 200 OK in 1ms (Views: 0.5ms)
750
+ ----------------------------------------------------
751
+ MaturateRequestTest: test_api_version_set_by_request
752
+ ----------------------------------------------------
753
+ Processing by HumansController#index as HTML
754
+ Parameters: {"api_version"=>"v1"}
755
+ Rendered text template (0.0ms)
756
+ Completed 200 OK in 1ms (Views: 0.4ms)
757
+ -----------------------------------------------------------
758
+ MaturateRequestTest: test_url_version_param_can_be_disabled
759
+ -----------------------------------------------------------
760
+ Processing by HumansController#index2 as HTML
761
+ Parameters: {"api_version"=>"v1"}
762
+ Rendered text template (0.0ms)
763
+ Completed 200 OK in 1ms (Views: 0.4ms)
764
+ --------------------------------------------------------
765
+ MaturateRequestTest: test_unknown_version_maps_to_latest
766
+ --------------------------------------------------------
767
+ Processing by HumansController#index as HTML
768
+ Parameters: {"api_version"=>"?????????"}
769
+ Rendered text template (0.0ms)
770
+ Completed 200 OK in 1ms (Views: 0.5ms)
771
+ ------------------------------------------------------------------------
772
+ MaturateRequestTest: test_url_generation_includes_api_version_by_default
773
+ ------------------------------------------------------------------------
774
+ Processing by HumansController#index as HTML
775
+ Parameters: {"api_version"=>"v1"}
776
+ Rendered text template (0.0ms)
777
+ Completed 200 OK in 1ms (Views: 0.4ms)
@@ -1,7 +1,67 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class MaturateTest < ActiveSupport::TestCase
4
- test "truth" do
5
- assert_kind_of Module, Maturate
4
+ setup do
5
+ @controller = Class.new(ActionController::Base) { extend Maturate }
6
+ end
7
+
8
+ test 'can set api version on controller' do
9
+ assert @controller.respond_to?(:api_versions=)
10
+ end
11
+
12
+ test 'api versions are readable' do
13
+ @controller.api_versions = ['a', 'b']
14
+ assert_equal ['a', 'b'], @controller.api_versions
15
+ end
16
+
17
+ test 'can set current_api_version to a known version' do
18
+ @controller.api_versions = ['a', 'b']
19
+ assert_send [@controller, :current_api_version=, 'b']
20
+ end
21
+
22
+ test 'cannot set current_api_version to an unknown version' do
23
+ @controller.api_versions = ['a', 'b']
24
+ assert_raises(Maturate::InvalidVersion) do
25
+ @controller.current_api_version = 'c'
26
+ end
27
+ end
28
+ end
29
+
30
+ class MaturateRequestTest < ActionController::TestCase
31
+ tests HumansController
32
+
33
+ test 'api_version set by request' do
34
+ get :index, api_version: 'v1'
35
+ assert_equal [:v1], request.variant
36
+ end
37
+
38
+ test 'current symbolic-version maps to latest' do
39
+ get :index, api_version: 'curent'
40
+ assert_equal [:v2], request.variant
41
+ end
42
+
43
+ test 'unknown version maps to latest' do
44
+ get :index, api_version: '?????????'
45
+ assert_equal [:v2], request.variant
46
+ end
47
+
48
+ test 'latest version can be set manually' do
49
+ begin
50
+ ApplicationController.current_api_version = 'v1'
51
+ get :index, api_version: 'current'
52
+ assert_equal [:v1], request.variant
53
+ ensure
54
+ ApplicationController._current_api_version = nil
55
+ end
56
+ end
57
+
58
+ test 'url generation includes api_version by default' do
59
+ get :index, api_version: 'v1'
60
+ assert_equal '/api/v1/humans', response.headers['Location']
61
+ end
62
+
63
+ test 'url version param can be disabled' do
64
+ get :index2, api_version: 'v1'
65
+ assert_equal '/not-api/benefits_packages', response.headers['Location']
6
66
  end
7
67
  end
data/test/test_helper.rb CHANGED
@@ -2,7 +2,6 @@
2
2
  ENV["RAILS_ENV"] = "test"
3
3
 
4
4
  require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
5
- ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
6
5
  require "rails/test_help"
7
6
 
8
7
  # Filter out Minitest backtrace while allowing backtrace from other libraries
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maturate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todd Willey <todd.willey@cirrusmio.com>
@@ -57,6 +57,7 @@ files:
57
57
  - test/dummy/app/assets/javascripts/application.js
58
58
  - test/dummy/app/assets/stylesheets/application.css
59
59
  - test/dummy/app/controllers/application_controller.rb
60
+ - test/dummy/app/controllers/humans_controller.rb
60
61
  - test/dummy/app/helpers/application_helper.rb
61
62
  - test/dummy/app/views/layouts/application.html.erb
62
63
  - test/dummy/bin/bundle
@@ -66,7 +67,6 @@ files:
66
67
  - test/dummy/config.ru
67
68
  - test/dummy/config/application.rb
68
69
  - test/dummy/config/boot.rb
69
- - test/dummy/config/database.yml
70
70
  - test/dummy/config/environment.rb
71
71
  - test/dummy/config/environments/development.rb
72
72
  - test/dummy/config/environments/production.rb
@@ -82,6 +82,8 @@ files:
82
82
  - test/dummy/config/locales/en.yml
83
83
  - test/dummy/config/routes.rb
84
84
  - test/dummy/config/secrets.yml
85
+ - test/dummy/db/test.sqlite3
86
+ - test/dummy/log/test.log
85
87
  - test/dummy/public/404.html
86
88
  - test/dummy/public/422.html
87
89
  - test/dummy/public/500.html
@@ -116,6 +118,7 @@ test_files:
116
118
  - test/dummy/app/assets/javascripts/application.js
117
119
  - test/dummy/app/assets/stylesheets/application.css
118
120
  - test/dummy/app/controllers/application_controller.rb
121
+ - test/dummy/app/controllers/humans_controller.rb
119
122
  - test/dummy/app/helpers/application_helper.rb
120
123
  - test/dummy/app/views/layouts/application.html.erb
121
124
  - test/dummy/bin/bundle
@@ -124,7 +127,6 @@ test_files:
124
127
  - test/dummy/bin/setup
125
128
  - test/dummy/config/application.rb
126
129
  - test/dummy/config/boot.rb
127
- - test/dummy/config/database.yml
128
130
  - test/dummy/config/environment.rb
129
131
  - test/dummy/config/environments/development.rb
130
132
  - test/dummy/config/environments/production.rb
@@ -141,6 +143,8 @@ test_files:
141
143
  - test/dummy/config/routes.rb
142
144
  - test/dummy/config/secrets.yml
143
145
  - test/dummy/config.ru
146
+ - test/dummy/db/test.sqlite3
147
+ - test/dummy/log/test.log
144
148
  - test/dummy/public/404.html
145
149
  - test/dummy/public/422.html
146
150
  - test/dummy/public/500.html
@@ -1,25 +0,0 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3
3
- #
4
- # Ensure the SQLite 3 gem is defined in your Gemfile
5
- # gem 'sqlite3'
6
- #
7
- default: &default
8
- adapter: sqlite3
9
- pool: 5
10
- timeout: 5000
11
-
12
- development:
13
- <<: *default
14
- database: db/development.sqlite3
15
-
16
- # Warning: The database defined as "test" will be erased and
17
- # re-generated from your development database when you run "rake".
18
- # Do not set this db to the same as development or production.
19
- test:
20
- <<: *default
21
- database: db/test.sqlite3
22
-
23
- production:
24
- <<: *default
25
- database: db/production.sqlite3