route_mechanic 0.1.2 → 0.1.3
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/README.md +1 -1
- data/fixtures/fake_app/lib/engine.rb +5 -0
- data/fixtures/fake_app/rails_app.rb +3 -0
- data/lib/route_mechanic/testing/methods.rb +1 -1
- data/lib/route_mechanic/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a45e646ff04b613cb52b102ff6d47ef3b02750fe4455eab2d081e549c37313f
|
4
|
+
data.tar.gz: 4df4c8d6bc5dee7e15338a93e1a8f1f468e3e76dd7299b80baf14922322ca0bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2dbdb3b471fc9d47686fb4b924f3a32843a3d5dce778a64706fe72b4127a84cdaa09dcc3b0bc2527ff6b6b77b393d8af5124595bd62d17fc10651e82fef2978
|
7
|
+
data.tar.gz: b47585e146f2e8aa6af03802794c3cb8206057adb216fb54581871baba4a820b0103bfbe45885491de8aaaf0f54c52279885ff1fef30fa58c585cd743c3434f6
|
data/README.md
CHANGED
@@ -33,7 +33,7 @@ Just add a test file which has only one test case using `have_valid_routes` matc
|
|
33
33
|
```ruby
|
34
34
|
RSpec.describe 'Rails.application', type: :routing do
|
35
35
|
it "fails if application does not have valid routes" do
|
36
|
-
|
36
|
+
expect(Rails.application).to have_valid_routes
|
37
37
|
end
|
38
38
|
end
|
39
39
|
```
|
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'rails/application'
|
2
2
|
require "action_controller/railtie"
|
3
3
|
|
4
|
+
require_relative './lib/engine'
|
5
|
+
|
4
6
|
FakeApp = Class.new(Rails::Application)
|
5
7
|
FakeApp.config.eager_load = false
|
6
8
|
FakeApp.config.hosts << 'www.example.com' if FakeApp.config.respond_to?(:hosts)
|
@@ -10,5 +12,6 @@ FakeApp.initialize!
|
|
10
12
|
FakeApp.routes.draw do
|
11
13
|
resources :users do
|
12
14
|
get 'friends', to: :friends
|
15
|
+
mount FakeEngine::Engine, at: "/fake_engine", fake_default_param: 'FAKE'
|
13
16
|
end
|
14
17
|
end
|
@@ -78,7 +78,7 @@ module RouteMechanic
|
|
78
78
|
# Skip internals, endpoints that Rails adds by default
|
79
79
|
# Also Engines should be skipped since Engine's tests should be done in Engine
|
80
80
|
wrapper = RouteWrapper.new(journey_route)
|
81
|
-
wrapper.internal? || wrapper.
|
81
|
+
wrapper.internal? || !wrapper.defaults[:controller] || !wrapper.defaults[:action] || wrapper.path.start_with?('/rails/')
|
82
82
|
end
|
83
83
|
end
|
84
84
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ohbarye
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -51,6 +51,7 @@ files:
|
|
51
51
|
- bin/setup
|
52
52
|
- fixtures/fake_app/app/controllers/application_controller.rb
|
53
53
|
- fixtures/fake_app/app/controllers/users_controller.rb
|
54
|
+
- fixtures/fake_app/lib/engine.rb
|
54
55
|
- fixtures/fake_app/rails_app.rb
|
55
56
|
- lib/route_mechanic.rb
|
56
57
|
- lib/route_mechanic/rspec/matchers.rb
|