blacklight 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. data/VERSION +1 -1
  2. data/app/helpers/blacklight_helper.rb +2 -215
  3. data/app/helpers/facets_helper.rb +114 -0
  4. data/app/helpers/html_head_helper.rb +103 -0
  5. data/app/views/catalog/_document.html.erb +0 -2
  6. data/app/views/catalog/show.html.erb +0 -1
  7. data/app/views/kaminari/blacklight/_paginator.html.erb +1 -1
  8. data/lib/blacklight.rb +1 -0
  9. data/lib/blacklight/catalog.rb +0 -22
  10. data/lib/blacklight/kaminari_relevant_pages_patch.rb +37 -0
  11. data/lib/blacklight/routes.rb +0 -1
  12. data/lib/blacklight/solr/document.rb +3 -3
  13. data/lib/blacklight/solr_helper.rb +2 -2
  14. data/lib/generators/blacklight/assets_generator.rb +1 -1
  15. data/lib/generators/blacklight/templates/config/blacklight_config.rb +7 -13
  16. data/lib/railties/blacklight_rspec.rake +3 -1
  17. data/test_support/bin/run-tests.sh +64 -0
  18. data/test_support/bin/test.sh +12 -4
  19. data/test_support/features/step_definitions/search_steps.rb +0 -4
  20. data/test_support/features/support/paths.rb +0 -9
  21. data/test_support/spec/controllers/catalog_controller_spec.rb +0 -45
  22. data/test_support/spec/helpers/blacklight_helper_spec.rb +2 -174
  23. data/test_support/spec/helpers/facets_helper_spec.rb +100 -0
  24. data/test_support/spec/helpers/html_head_helper_spec.rb +90 -0
  25. data/test_support/spec/helpers/solr_helper_spec.rb +1 -1
  26. metadata +85 -120
  27. data/app/views/catalog/_unapi_microformat.html.erb +0 -1
  28. data/app/views/catalog/unapi.xml.builder +0 -6
  29. data/test_support/features/unapi.feature +0 -30
  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,6 +0,0 @@
1
- xml.instruct!
2
- xml.formats(({:id => @document.id} if @document) || {}) do
3
- @export_formats.each do |shortname, meta|
4
- xml.format :name => shortname, :type => meta[:content_type]
5
- end
6
- end
@@ -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