route_mechanic 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile +1 -0
- data/fixtures/fake_app/rails_app.rb +7 -0
- data/lib/route_mechanic/testing/methods.rb +7 -1
- data/lib/route_mechanic/version.rb +1 -1
- data/route_mechanic.gemspec +1 -0
- metadata +21 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 880e2dd0341ed11d953e4a4d27e71431ef393049153224f62231ba3c527252c8
|
4
|
+
data.tar.gz: '0592972c3d62edf50cbeb1f4bcfee4473921e789c31eff61cd2673927c22013b'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a75f67529149119f59e7e78082a4364ea98b15c4906959a75d4970420a877444d36c37e150f21ab4a2a7e347daf80afe2645072f40d93cff18d57a6427fa5e1
|
7
|
+
data.tar.gz: 71dd0672e63045a5c386ce4510712f75472a07abc236a8d73b696a361ef4fd65a394afb2578ac8f8b3c216d9d4f5e7142cc823fbef67e52c99b65a28f129fd8d
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
@@ -14,6 +14,13 @@ FakeApp.routes.draw do
|
|
14
14
|
get '/constraints_test' => 'users#index'
|
15
15
|
end
|
16
16
|
|
17
|
+
scope ':locale', locale: /en|ja/ do
|
18
|
+
get '/locale_test', to: 'photos#index'
|
19
|
+
get '/photos/:id', to: 'photos#show', constraints: { id: /[A-Z]\d{5}/ }
|
20
|
+
end
|
21
|
+
|
22
|
+
get 'organizations/:id', to: 'organizations#show', id: /[A-Z]\d{5}/
|
23
|
+
|
17
24
|
resources :users do
|
18
25
|
get 'friends', to: :friends
|
19
26
|
mount FakeEngine::Engine, at: "/fake_engine", fake_default_param: 'FAKE'
|
@@ -3,6 +3,7 @@ require "route_mechanic/testing/error_aggregator"
|
|
3
3
|
require "route_mechanic/testing/minitest_assertion_adopter"
|
4
4
|
require "action_controller"
|
5
5
|
require "action_controller/test_case"
|
6
|
+
require "regexp-examples"
|
6
7
|
|
7
8
|
module RouteMechanic
|
8
9
|
module Testing
|
@@ -45,7 +46,12 @@ module RouteMechanic
|
|
45
46
|
# @raise [Minitest::Assertion]
|
46
47
|
def assert_routes(wrapper)
|
47
48
|
required_parts = wrapper.required_parts.reduce({}) do |memo, required_part|
|
48
|
-
|
49
|
+
dummy = if wrapper.requirements[required_part].is_a?(Regexp)
|
50
|
+
wrapper.requirements[required_part].examples.last
|
51
|
+
else
|
52
|
+
'1'
|
53
|
+
end
|
54
|
+
memo.merge({ required_part => dummy }) # Set pseudo params to meets requirements
|
49
55
|
end
|
50
56
|
|
51
57
|
base_option = { controller: wrapper.controller, action: wrapper.action }
|
data/route_mechanic.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: route_mechanic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ohbarye
|
@@ -30,6 +30,26 @@ dependencies:
|
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '6.1'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: regexp-examples
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '1.5'
|
40
|
+
- - "<"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '2'
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '1.5'
|
50
|
+
- - "<"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '2'
|
33
53
|
description: No need to maintain Rails' routing tests manually. RouteMechanic automatically
|
34
54
|
detects broken routes and missing action methods in controller once you've finished
|
35
55
|
installation.
|