publish_my_data 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/publish_my_data/resources_controller.rb +22 -14
- data/app/views/layouts/publish_my_data/error.html.haml +1 -1
- data/config/routes.rb +2 -1
- data/lib/publish_my_data/version.rb +1 -1
- data/spec/dummy/log/test.log +17560 -0
- data/spec/factories/resource_factories.rb +12 -1
- data/spec/features/viewing_resources_spec.rb +19 -1
- metadata +3 -4
- data/app/controllers/publish_my_data/errors_controller.rb +0 -10
@@ -55,4 +55,15 @@ FactoryGirl.define do
|
|
55
55
|
res.write_predicate(RDF::RDFS.label, 'Observation')
|
56
56
|
end
|
57
57
|
end
|
58
|
-
|
58
|
+
|
59
|
+
factory :arbitrary_local_resource, class: PublishMyData::Resource do
|
60
|
+
initialize_with { new(uri, graph_uri) }
|
61
|
+
ignore do
|
62
|
+
uri { "http://#{PublishMyData.local_domain}/arbitrary/uri/pattern" }
|
63
|
+
graph_uri { "http://#{PublishMyData.local_domain}/graph/unicorns" }
|
64
|
+
end
|
65
|
+
after(:build) do |res|
|
66
|
+
res.write_predicate(RDF::RDFS.label, 'An arbitrary local resource that can be dereferenced')
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -93,4 +93,22 @@ feature 'Viewing resources' do
|
|
93
93
|
page.should have_content(concept_scheme.concepts.first.label)
|
94
94
|
end
|
95
95
|
end
|
96
|
-
|
96
|
+
|
97
|
+
context 'Given an arbitrary local resource' do
|
98
|
+
given(:resource) { FactoryGirl.create(:arbitrary_local_resource) }
|
99
|
+
|
100
|
+
scenario 'Visitor dereferences the uri' do
|
101
|
+
visit resource.uri
|
102
|
+
page.should have_content 'An arbitrary local resource that can be dereferenced'
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
context 'When requesting an unknown resource in arbitrary local resource style' do
|
107
|
+
scenario 'Visitor dereferences the uri' do
|
108
|
+
visit "/an/arbitrary/unknown/resource"
|
109
|
+
expect(page.status_code).to eq(404)
|
110
|
+
expect(page).to have_content("Resource not found")
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: publish_my_data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -16,7 +16,7 @@ authors:
|
|
16
16
|
autorequire:
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
|
-
date: 2014-02-
|
19
|
+
date: 2014-02-28 00:00:00.000000000 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: rails
|
@@ -365,7 +365,6 @@ files:
|
|
365
365
|
- app/controllers/publish_my_data/data_cube/observations_controller.rb
|
366
366
|
- app/controllers/publish_my_data/datasets_controller.rb
|
367
367
|
- app/controllers/publish_my_data/docs_controller.rb
|
368
|
-
- app/controllers/publish_my_data/errors_controller.rb
|
369
368
|
- app/controllers/publish_my_data/example_resources_controller.rb
|
370
369
|
- app/controllers/publish_my_data/information_resources_controller.rb
|
371
370
|
- app/controllers/publish_my_data/queries_controller.rb
|
@@ -545,7 +544,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
545
544
|
version: '0'
|
546
545
|
segments:
|
547
546
|
- 0
|
548
|
-
hash:
|
547
|
+
hash: 3204406259821179385
|
549
548
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
550
549
|
none: false
|
551
550
|
requirements:
|
@@ -1,10 +0,0 @@
|
|
1
|
-
#http://accuser.cc/posts/1-rails-3-0-exception-handling
|
2
|
-
module PublishMyData
|
3
|
-
class ErrorsController < ApplicationController
|
4
|
-
def routing
|
5
|
-
Rails.logger.debug(">>> In ErrorsController:Routing. Raising not found")
|
6
|
-
# just re-raise a tripod not found error. Handled in Application Controller
|
7
|
-
raise Tripod::Errors::ResourceNotFound
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|