route_mechanic 0.1.3 → 0.1.4
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 +4 -4
- data/fixtures/fake_app/rails_app.rb +4 -0
- data/lib/route_mechanic/testing/methods.rb +6 -1
- data/lib/route_mechanic/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcf55f8d2a48c7a0ff01db79aef7007f04debdf0041446ad54dbee8ef96ef1c9
|
4
|
+
data.tar.gz: ec43017513f3cb41e85463eb87c0ba6717395fce97cad5cff706a404ddf60bdc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2c1f56abcb02e80ea81ccc44cb39fff35166fbc94d413ff8ae838ec98d7c867ddad8a089ce3ad30416c15f331268438e3f06880eabac2c41ba750d062387101
|
7
|
+
data.tar.gz: 11719f321b17f608408c2d5f195fa332a1a95ef1f491ce23fd3e7a9af2e82e3b940a934bdc5dd96f5d3c6a11bd6b51da895eb8a013b20d5ee42a30d6d6c87354
|
@@ -10,6 +10,10 @@ FakeApp.config.root = File.dirname(__FILE__)
|
|
10
10
|
FakeApp.initialize!
|
11
11
|
|
12
12
|
FakeApp.routes.draw do
|
13
|
+
constraints subdomain: /\A[0-9a-z-]+\z/ do
|
14
|
+
get '/constraints_test' => 'users#index'
|
15
|
+
end
|
16
|
+
|
13
17
|
resources :users do
|
14
18
|
get 'friends', to: :friends
|
15
19
|
mount FakeEngine::Engine, at: "/fake_engine", fake_default_param: 'FAKE'
|
@@ -53,7 +53,12 @@ module RouteMechanic
|
|
53
53
|
base_option.merge({ only_path: true }).merge(required_parts))
|
54
54
|
expected_options = base_option.merge(required_parts)
|
55
55
|
|
56
|
-
|
56
|
+
assert_generates(url, expected_options)
|
57
|
+
# Q. Why not using `assert_routing` or `assert_recognize`?
|
58
|
+
# A. They strictly checks `constraints` in routes.rb and
|
59
|
+
# this gem can't generate a request that meets whole constraints just in time.
|
60
|
+
# https://github.com/ohbarye/route_mechanic/issues/7#issuecomment-695957142
|
61
|
+
# https://guides.rubyonrails.org/routing.html#specifying-constraints
|
57
62
|
end
|
58
63
|
|
59
64
|
# @return [Array<Controller>]
|