dynamic_router 0.0.7 → 0.0.9

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: 24d27770b5081ed9db7948b588e1dfda7fce51ee
4
- data.tar.gz: f00cd96dbc4af56ea60d87b44a31b42b5039447a
3
+ metadata.gz: a6f602701fcab286e0c5e053bcd6a82d54ebaa7e
4
+ data.tar.gz: 17cd846d4ba3d9e787fd0eb8d7f996e8726811d4
5
5
  SHA512:
6
- metadata.gz: a5437e512a9156f5b9cc97dde7416e4fbd8093cc1ea1a87b9f28b275f33e19c55447376227259d51365ce601aa9c89c92cff309a5eb8922b0d8a067650f65678
7
- data.tar.gz: d639cb3ba0744bbca4aa82f0f2c4babddb59a5d42b05d695486e03563241a408c0b69011e52f77543126f15b7c3e4a749fd87546b43d71f14fa4c84c0fb46a59
6
+ metadata.gz: 78fb249b744d7ba4abccf31f209a99fecdcd38f5f38fa29504fe44d71659a29e9cd483df4306d5c7f74f8ad039f151e06ad33562d5210aedfa71d7d95c687507
7
+ data.tar.gz: 273e48fca1662ea204383cfc3036fdeefabe653ab6f1665f326a0a5fe3e2a45bfc6d7e982e0c57d09535cf689bfe82a87b431bc3ee47dbf2db4e44edcda66ebc
@@ -1,3 +1,3 @@
1
1
  module DynamicRouter
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -2,6 +2,9 @@ require 'spec_helper'
2
2
 
3
3
  RSpec.describe DynamicRouter do
4
4
  before(:each) do
5
+ class Example < ActiveRecord::Base
6
+ end
7
+
5
8
  Example.destroy_all
6
9
 
7
10
  Example.create!(:first_path => "path_a", :second_path => "path_a_a", :default_field => "default_value")
@@ -44,14 +47,10 @@ RSpec.describe DynamicRouter do
44
47
  expect(Rails.application.routes.routes.named_routes["path_a_path_a_a"].defaults).to match a_hash_including(:default_value => "default_value")
45
48
  end
46
49
 
47
- it "should create the route after save the model" do
48
- Rails.application.routes.draw do
49
- DynamicRouter.has_dynamic_route_for(Example, Proc.new {|example| "/#{example.first_path}/#{example.second_path}"}, "dummy#dummy_method", :defaults => {:default_value => Proc.new {|example| example.default_field}})
50
- end
50
+ it "should reload the routes after save the model" do
51
+ expect(Rails.application.routes_reloader).to receive(:reload!)
51
52
 
52
53
  Example.create!(:first_path => "path_a", :second_path => "path_a_b")
53
-
54
- expect(Rails.application.routes.recognize_path('/path_a/path_a_b', :method => :get))
55
54
  end
56
55
 
57
56
  it "should not create the route if the url is blank" do
@@ -63,12 +62,8 @@ RSpec.describe DynamicRouter do
63
62
  end
64
63
 
65
64
  it "should not create the route if the url eval to blank" do
66
- Rails.application.routes.draw do
67
- DynamicRouter.has_dynamic_route_for(Example, Proc.new {|example| "/#{example.first_path}/#{example.second_path}"}, "dummy#dummy_method")
68
- end
69
-
70
65
  Example.create!(:first_path => "")
71
66
 
72
- expect(Rails.application.routes.routes.named_routes.size).to eq(2)
67
+ expect(Rails.application.routes.routes.named_routes.size).to eq(0)
73
68
  end
74
69
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamic_router
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gustavo Berdugo