publish_my_data 1.3.0 → 1.3.1

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.
@@ -55,4 +55,15 @@ FactoryGirl.define do
55
55
  res.write_predicate(RDF::RDFS.label, 'Observation')
56
56
  end
57
57
  end
58
- end
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
- end
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.0
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-20 00:00:00.000000000 Z
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: -4484494326852078410
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