utopia 1.0.10 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/utopia/content.rb +3 -1
- data/lib/utopia/version.rb +1 -1
- data/spec/utopia/content_spec.rb +7 -0
- data/spec/utopia/pages/content/links.yaml +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb9c01f8a43932f752a9588dd957deb2afec170c
|
4
|
+
data.tar.gz: 85654a0ecc710fb663616fd7afda1a3da995790e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a1de4ccb2fa9a111cefce7ff9c19c065b8551e1cbf6bf8a919d7db6c38a31b5b5b8c4edd7fe23fce192aa17635a74f0c170749c9cb03b78c068c872bf1db8fa
|
7
|
+
data.tar.gz: 6aa5e5815944530c84c53d14929993036cc09b3f0d4911ed68c6a7dbf2a1db495ec3d4eccb43edd2e9632d5003a262b58cd6c11e379407b27d8b86af8ae4537e
|
data/lib/utopia/content.rb
CHANGED
@@ -119,7 +119,7 @@ module Utopia
|
|
119
119
|
|
120
120
|
locale = env[Localization::CURRENT_LOCALE_KEY]
|
121
121
|
if link = Links.for(@root, path, locale)
|
122
|
-
if node = lookup_node(link.path)
|
122
|
+
if link.path and node = lookup_node(link.path)
|
123
123
|
response = Rack::Response.new
|
124
124
|
|
125
125
|
attributes = nil
|
@@ -131,6 +131,8 @@ module Utopia
|
|
131
131
|
node.process!(request, response, (attributes || {}).to_hash)
|
132
132
|
|
133
133
|
return response.finish
|
134
|
+
elsif redirect_uri = link[:uri]
|
135
|
+
return [307, {"Location" => redirect_uri}, []]
|
134
136
|
end
|
135
137
|
end
|
136
138
|
|
data/lib/utopia/version.rb
CHANGED
data/spec/utopia/content_spec.rb
CHANGED
@@ -56,6 +56,13 @@ module Utopia::ContentSpec
|
|
56
56
|
|
57
57
|
expect(last_response.body).to be == '10'
|
58
58
|
end
|
59
|
+
|
60
|
+
it "should successfully redirect to the foo page" do
|
61
|
+
get '/content/redirect'
|
62
|
+
|
63
|
+
expect(last_response.status).to be == 307
|
64
|
+
expect(last_response.headers['Location']).to be == 'foo'
|
65
|
+
end
|
59
66
|
end
|
60
67
|
|
61
68
|
describe Utopia::Content do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: utopia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trenni
|
@@ -239,6 +239,7 @@ files:
|
|
239
239
|
- spec/utopia/middleware_spec.rb
|
240
240
|
- spec/utopia/pages/_heading.xnode
|
241
241
|
- spec/utopia/pages/content/_show-value.xnode
|
242
|
+
- spec/utopia/pages/content/links.yaml
|
242
243
|
- spec/utopia/pages/content/test-partial.xnode
|
243
244
|
- spec/utopia/pages/controller/controller.rb
|
244
245
|
- spec/utopia/pages/controller/index.xnode
|
@@ -317,6 +318,7 @@ test_files:
|
|
317
318
|
- spec/utopia/middleware_spec.rb
|
318
319
|
- spec/utopia/pages/_heading.xnode
|
319
320
|
- spec/utopia/pages/content/_show-value.xnode
|
321
|
+
- spec/utopia/pages/content/links.yaml
|
320
322
|
- spec/utopia/pages/content/test-partial.xnode
|
321
323
|
- spec/utopia/pages/controller/controller.rb
|
322
324
|
- spec/utopia/pages/controller/index.xnode
|