rails_versioned_routing 1.3.1 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -27,4 +27,4 @@ class VersionedRoutingTest < ActionDispatch::IntegrationTest
27
27
  assert(!names(3).include?({:controller=>"v1/sample", :action=>"a_path_overridden_from_v1"}))
28
28
  assert(!names(2).include?({:controller=>"v1/sample", :action=>"a_path_overridden_from_v1"}))
29
29
  end
30
- end
30
+ end
@@ -1,6 +1,22 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class VersionedRoutingTest < ActionDispatch::IntegrationTest
4
+ test "a request with a 'beta' version matches as the highest version number" do
5
+ get '/a_path_overridden_from_v1/somevalue/whats/anothervalue', {}, {'Accept' => 'version=beta'}
6
+ assert_equal(response.body, 'beta')
7
+ end
8
+
9
+ test "a route defined in beta matches for beta requests" do
10
+ get '/a_path_only_in_beta', {}, {'Accept' => 'version=beta'}
11
+ assert_equal(response.body, 'beta')
12
+ end
13
+
14
+ test "a route defined in beta is not present in lower versions" do
15
+ assert_raise ActionController::RoutingError do
16
+ get '/a_path_only_in_beta', {}, {'Accept' => 'version=2'}
17
+ end
18
+ end
19
+
4
20
  test "a request without a verison cascades to versionless routes" do
5
21
  get '/final_fallback'
6
22
  assert_equal(response.body, 'v0')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_versioned_routing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trek Glowacki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-03 00:00:00.000000000 Z
11
+ date: 2018-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -17,9 +17,6 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 4.2.0
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '6.0'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,21 +24,18 @@ dependencies:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: 4.2.0
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '6.0'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: sqlite3
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
- - - "~>"
31
+ - - ">="
38
32
  - !ruby/object:Gem::Version
39
33
  version: '0'
40
34
  type: :development
41
35
  prerelease: false
42
36
  version_requirements: !ruby/object:Gem::Requirement
43
37
  requirements:
44
- - - "~>"
38
+ - - ">="
45
39
  - !ruby/object:Gem::Version
46
40
  version: '0'
47
41
  description: "..."
@@ -61,6 +55,7 @@ files:
61
55
  - test/dummy/app/assets/javascripts/application.js
62
56
  - test/dummy/app/assets/stylesheets/application.css
63
57
  - test/dummy/app/controllers/application_controller.rb
58
+ - test/dummy/app/controllers/beta/sample_controller.rb
64
59
  - test/dummy/app/controllers/sample_controller.rb
65
60
  - test/dummy/app/controllers/v1/sample_controller.rb
66
61
  - test/dummy/app/controllers/v2/sample_controller.rb
@@ -88,6 +83,8 @@ files:
88
83
  - test/dummy/config/locales/en.yml
89
84
  - test/dummy/config/routes.rb
90
85
  - test/dummy/db/schema.rb
86
+ - test/dummy/db/test.sqlite3
87
+ - test/dummy/log/test.log
91
88
  - test/dummy/public/404.html
92
89
  - test/dummy/public/422.html
93
90
  - test/dummy/public/500.html
@@ -122,6 +119,7 @@ test_files:
122
119
  - test/dummy/app/assets/javascripts/application.js
123
120
  - test/dummy/app/assets/stylesheets/application.css
124
121
  - test/dummy/app/controllers/application_controller.rb
122
+ - test/dummy/app/controllers/beta/sample_controller.rb
125
123
  - test/dummy/app/controllers/sample_controller.rb
126
124
  - test/dummy/app/controllers/v1/sample_controller.rb
127
125
  - test/dummy/app/controllers/v2/sample_controller.rb
@@ -149,6 +147,8 @@ test_files:
149
147
  - test/dummy/config/routes.rb
150
148
  - test/dummy/config.ru
151
149
  - test/dummy/db/schema.rb
150
+ - test/dummy/db/test.sqlite3
151
+ - test/dummy/log/test.log
152
152
  - test/dummy/public/404.html
153
153
  - test/dummy/public/422.html
154
154
  - test/dummy/public/500.html