blacklight 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/helpers/blacklight_helper.rb +2 -215
- data/app/helpers/facets_helper.rb +114 -0
- data/app/helpers/html_head_helper.rb +103 -0
- data/app/views/catalog/_document.html.erb +0 -2
- data/app/views/catalog/show.html.erb +0 -1
- data/app/views/kaminari/blacklight/_paginator.html.erb +1 -1
- data/lib/blacklight.rb +1 -0
- data/lib/blacklight/catalog.rb +0 -22
- data/lib/blacklight/kaminari_relevant_pages_patch.rb +37 -0
- data/lib/blacklight/routes.rb +0 -1
- data/lib/blacklight/solr/document.rb +3 -3
- data/lib/blacklight/solr_helper.rb +2 -2
- data/lib/generators/blacklight/assets_generator.rb +1 -1
- data/lib/generators/blacklight/templates/config/blacklight_config.rb +7 -13
- data/lib/railties/blacklight_rspec.rake +3 -1
- data/test_support/bin/run-tests.sh +64 -0
- data/test_support/bin/test.sh +12 -4
- data/test_support/features/step_definitions/search_steps.rb +0 -4
- data/test_support/features/support/paths.rb +0 -9
- data/test_support/spec/controllers/catalog_controller_spec.rb +0 -45
- data/test_support/spec/helpers/blacklight_helper_spec.rb +2 -174
- data/test_support/spec/helpers/facets_helper_spec.rb +100 -0
- data/test_support/spec/helpers/html_head_helper_spec.rb +90 -0
- data/test_support/spec/helpers/solr_helper_spec.rb +1 -1
- metadata +85 -120
- data/app/views/catalog/_unapi_microformat.html.erb +0 -1
- data/app/views/catalog/unapi.xml.builder +0 -6
- data/test_support/features/unapi.feature +0 -30
- data/test_support/spec/views/catalog/unapi.xml.builder_spec.rb +0 -46
@@ -1 +0,0 @@
|
|
1
|
-
<%= content_tag :abbr, '', :class => 'unapi-id', :title => document.id %>
|
@@ -1,30 +0,0 @@
|
|
1
|
-
@unapi
|
2
|
-
Feature: unAPI
|
3
|
-
In order to discover underlying document data
|
4
|
-
As a user
|
5
|
-
I want to use an unAPI endpoint
|
6
|
-
|
7
|
-
Scenario: Search Page has unAPI discovery link and microformats
|
8
|
-
When I go to the catalog page
|
9
|
-
And I fill in the search box with ""
|
10
|
-
And I press "search"
|
11
|
-
Then I should see an unAPI discovery link
|
12
|
-
And I should see a "abbr" element with "class" = "unapi-id" exactly 10 times
|
13
|
-
|
14
|
-
Scenario: Document Page has an unAPI discovery link and microformat
|
15
|
-
Given I am on the document page for id 2007020969
|
16
|
-
Then I should see an unAPI discovery link
|
17
|
-
And I should see a "abbr" element with "class" = "unapi-id" at least 1 time
|
18
|
-
|
19
|
-
Scenario: unAPI endpoint with no parameters
|
20
|
-
When I go to the unAPI endpoint
|
21
|
-
Then I should see a "format" element with "name" = "oai_dc_xml" exactly 1 time
|
22
|
-
|
23
|
-
Scenario: Request list of formats for an object
|
24
|
-
When I go to the unAPI endpoint for "2007020969"
|
25
|
-
Then I should see a "format" element with "name" = "marc" exactly 1 time
|
26
|
-
Then I should see a "format" element with "name" = "oai_dc_xml" exactly 1 time
|
27
|
-
|
28
|
-
Scenario: Request format of object
|
29
|
-
When I go to the unAPI endpoint for "2007020969" with format "oai_dc_xml"
|
30
|
-
Then I should see "Strong Medicine speaks"
|
@@ -1,46 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
3
|
-
|
4
|
-
describe "unAPI formats list" do
|
5
|
-
|
6
|
-
|
7
|
-
before(:all) do
|
8
|
-
class UnapiMockDocument
|
9
|
-
include Blacklight::Solr::Document
|
10
|
-
end
|
11
|
-
module FakeExtension
|
12
|
-
def self.extended(document)
|
13
|
-
document.will_export_as(:mock, "application/mock")
|
14
|
-
end
|
15
|
-
|
16
|
-
def export_as_mock
|
17
|
-
"mock_export"
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
UnapiMockDocument.use_extension( FakeExtension )
|
22
|
-
end
|
23
|
-
|
24
|
-
it "should provide a list of object formats which should be supported for all documents" do
|
25
|
-
@export_formats = { :mock => { :content_type => "application/mock" } }
|
26
|
-
render :template => "catalog/unapi.xml.builder", :content_type => "application/mock"
|
27
|
-
h = Hash.from_xml(rendered)
|
28
|
-
|
29
|
-
h['formats'].should_not be_nil
|
30
|
-
h['formats']['format'].should_not be_nil
|
31
|
-
h['formats']['format']['name'].should == 'mock'
|
32
|
-
h['formats']['format']['type'].should == 'application/mock'
|
33
|
-
end
|
34
|
-
|
35
|
-
it "should provide a list of object formats available from the unAPI service for the document" do
|
36
|
-
@document = UnapiMockDocument.new({})
|
37
|
-
@export_formats = @document.export_formats
|
38
|
-
render :template => "catalog/unapi.xml.builder", :content_type => "application/mock"
|
39
|
-
h = Hash.from_xml(rendered)
|
40
|
-
|
41
|
-
h['formats'].should_not be_nil
|
42
|
-
h['formats']['format'].should_not be_nil
|
43
|
-
h['formats']['format']['name'].should == 'mock'
|
44
|
-
h['formats']['format']['type'].should == 'application/mock'
|
45
|
-
end
|
46
|
-
end
|