route_mechanic 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: edfa9dd2a475e94ffb5131cfb367f430a838ecc12d001e45414955b1f0d84ec5
4
- data.tar.gz: '039c3bbbc1f86d16336db76fb1e6b0879ee3e2d2b8bc8f64731988c64301c48c'
3
+ metadata.gz: 7a45e646ff04b613cb52b102ff6d47ef3b02750fe4455eab2d081e549c37313f
4
+ data.tar.gz: 4df4c8d6bc5dee7e15338a93e1a8f1f468e3e76dd7299b80baf14922322ca0bd
5
5
  SHA512:
6
- metadata.gz: ae134daadd7209a3d67e5e3c9b7e2615b168693f034d3abd34915568de2333b5ef0955f0b7f57a76734c0e06d56145cc8bf861f156567f9437ed5bd02199e1fd
7
- data.tar.gz: 97d0c73f8d437837742470795f4f9414c73af178f911d27e49eb5c5edbba5ebf51a9f7e0b0d1155e66f1f348a1aaf8ba1333513d48de6c41fe36afe8c0ac0e7f
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
- expect(Rails.application).to have_valid_routes
36
+ expect(Rails.application).to have_valid_routes
37
37
  end
38
38
  end
39
39
  ```
@@ -0,0 +1,5 @@
1
+ module FakeEngine
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace FakeEngine
4
+ end
5
+ end
@@ -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.required_defaults.empty? || wrapper.path.start_with?('/rails/')
81
+ wrapper.internal? || !wrapper.defaults[:controller] || !wrapper.defaults[:action] || wrapper.path.start_with?('/rails/')
82
82
  end
83
83
  end
84
84
  end
@@ -1,3 +1,3 @@
1
1
  module RouteMechanic
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  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.2
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-19 00:00:00.000000000 Z
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