blacklight 3.0pre1 → 3.0pre2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitmodules +0 -6
- data/README.rdoc +94 -87
- data/blacklight.gemspec +1 -1
- data/config/routes.rb +1 -1
- data/lib/blacklight.rb +2 -2
- data/lib/blacklight/catalog.rb +10 -12
- data/lib/blacklight/controller.rb +2 -2
- data/lib/blacklight/engine.rb +5 -2
- data/lib/blacklight/solr/document.rb +1 -1
- data/lib/blacklight/solr/document/marc.rb +1 -16
- data/lib/blacklight/solr_helper.rb +43 -14
- data/lib/blacklight/version.rb +1 -1
- data/lib/generators/blacklight/assets_generator.rb +25 -0
- data/lib/generators/blacklight/blacklight_generator.rb +16 -1
- data/lib/generators/blacklight/jetty_generator.rb +101 -0
- data/lib/generators/blacklight/solr_conf_generator.rb +25 -0
- data/lib/generators/blacklight/templates/catalog_controller.rb +0 -1
- data/lib/generators/blacklight/templates/config/solr.yml +14 -2
- data/lib/generators/blacklight/templates/public/images/{blacklight/bg.png → bg.png} +0 -0
- data/lib/generators/blacklight/templates/public/images/{blacklight/border.png → border.png} +0 -0
- data/lib/generators/blacklight/templates/public/images/{blacklight/bul_sq_gry.gif → bul_sq_gry.gif} +0 -0
- data/lib/generators/blacklight/templates/public/images/{blacklight/checkmark.gif → checkmark.gif} +0 -0
- data/lib/generators/blacklight/templates/public/images/{blacklight/logo.png → logo.png} +0 -0
- data/lib/generators/blacklight/templates/public/images/{blacklight/magnifying_glass.gif → magnifying_glass.gif} +0 -0
- data/lib/generators/blacklight/templates/public/images/{blacklight/remove.gif → remove.gif} +0 -0
- data/lib/generators/blacklight/templates/public/images/{blacklight/separator.gif → separator.gif} +0 -0
- data/lib/generators/blacklight/templates/public/images/{blacklight/start_over.gif → start_over.gif} +0 -0
- data/lib/generators/blacklight/templates/public/javascripts/blacklight.js +5 -0
- data/lib/generators/blacklight/templates/public/stylesheets/blacklight.css +9 -3
- data/lib/generators/blacklight/templates/solr_conf/schema.xml +339 -0
- data/lib/generators/blacklight/templates/solr_conf/solrconfig.xml +578 -0
- data/lib/railties/all_tests.rake +11 -0
- data/lib/railties/blacklight.rake +0 -52
- data/lib/railties/blacklight_cucumber.rake +125 -0
- data/lib/railties/blacklight_rspec.rake +128 -0
- data/lib/railties/{test_solr_server.rb → jetty_solr_server.rb} +22 -45
- data/lib/railties/solr_marc.rake +24 -5
- data/test_support/.rspec +1 -0
- data/test_support/data/test_data.utf8.mrc +1 -0
- data/test_support/features/bookmarks.feature +88 -0
- data/test_support/features/did_you_mean.feature +129 -0
- data/test_support/features/folder.feature +67 -0
- data/test_support/features/librarian_view.feature +17 -0
- data/test_support/features/record_view.feature +34 -0
- data/test_support/features/saved_searches.feature +49 -0
- data/test_support/features/search.feature +86 -0
- data/test_support/features/search_filters.feature +121 -0
- data/test_support/features/search_history.feature +95 -0
- data/test_support/features/search_results.feature +61 -0
- data/test_support/features/search_sort.feature +29 -0
- data/test_support/features/step_definitions/bookmarks_steps.rb +5 -0
- data/test_support/features/step_definitions/error_steps.rb +4 -0
- data/test_support/features/step_definitions/folder_steps.rb +26 -0
- data/test_support/features/step_definitions/general_steps.rb +49 -0
- data/test_support/features/step_definitions/record_view_steps.rb +11 -0
- data/test_support/features/step_definitions/saved_searches_steps.rb +21 -0
- data/test_support/features/step_definitions/search_facets_steps.rb +28 -0
- data/test_support/features/step_definitions/search_history_steps.rb +8 -0
- data/test_support/features/step_definitions/search_result_steps.rb +113 -0
- data/test_support/features/step_definitions/search_steps.rb +102 -0
- data/test_support/features/step_definitions/user_steps.rb +4 -0
- data/test_support/features/step_definitions/web_steps.rb +211 -0
- data/test_support/features/support/env.rb +49 -0
- data/test_support/features/support/paths.rb +55 -0
- data/test_support/features/support/selectors.rb +39 -0
- data/test_support/features/unapi.feature +30 -0
- data/test_support/spec/controllers/application_controller_spec.rb +22 -0
- data/test_support/spec/controllers/catalog_controller_spec.rb +480 -0
- data/test_support/spec/controllers/folder_controller_spec.rb +40 -0
- data/test_support/spec/controllers/search_history_controller_spec.rb +45 -0
- data/test_support/spec/data/sample_docs.yml +655 -0
- data/test_support/spec/data/test_data.utf8.mrc +1 -0
- data/test_support/spec/helpers/blacklight_helper_spec.rb +482 -0
- data/test_support/spec/helpers/hash_as_hidden_fields_spec.rb +23 -0
- data/test_support/spec/helpers/render_constraints_helper_spec.rb +64 -0
- data/test_support/spec/helpers/search_history_helper_spec.rb +11 -0
- data/test_support/spec/helpers/solr_helper_spec.rb +873 -0
- data/test_support/spec/lib/blacklight_email_spec.rb +23 -0
- data/test_support/spec/lib/blacklight_sms_spec.rb +23 -0
- data/test_support/spec/lib/blacklight_solr_document_dublin_core_spec.rb +41 -0
- data/test_support/spec/lib/blacklight_solr_document_marc_spec.rb +88 -0
- data/test_support/spec/lib/blacklight_solr_document_spec.rb +173 -0
- data/test_support/spec/lib/blacklight_spec.rb +39 -0
- data/test_support/spec/lib/configurable_spec.rb +97 -0
- data/test_support/spec/lib/facet_paginator_spec.rb +93 -0
- data/test_support/spec/lib/marc_export_spec.rb +444 -0
- data/test_support/spec/lib/search_fields_spec.rb +105 -0
- data/test_support/spec/lib/tasks/blacklight_task_spec.rb +21 -0
- data/test_support/spec/lib/tasks/solr_marc_task_spec.rb +59 -0
- data/test_support/spec/models/bookmark_spec.rb +37 -0
- data/test_support/spec/models/record_mailer_spec.rb +67 -0
- data/test_support/spec/models/search_spec.rb +55 -0
- data/test_support/spec/models/solr_docment_spec.rb +111 -0
- data/test_support/spec/rcov.opts +3 -0
- data/test_support/spec/spec.opts +4 -0
- data/test_support/spec/spec_helper.rb +38 -0
- data/test_support/spec/support/action_controller.rb +42 -0
- data/test_support/spec/support/assert_difference.rb +16 -0
- data/test_support/spec/support/include_text.rb +20 -0
- data/test_support/spec/views/catalog/_constraints_element.html.erb_spec.rb +59 -0
- data/test_support/spec/views/catalog/_document_list.html.erb_spec.rb +8 -0
- data/test_support/spec/views/catalog/_facets.html.erb_spec.rb +182 -0
- data/test_support/spec/views/catalog/_index_partials/_default.erb_spec.rb +70 -0
- data/test_support/spec/views/catalog/_show_partials/_default.html.erb_spec.rb +70 -0
- data/test_support/spec/views/catalog/index.atom.builder_spec.rb +141 -0
- data/test_support/spec/views/catalog/show.html.erb_spec.rb +100 -0
- data/test_support/spec/views/catalog/unapi.xml.builder_spec.rb +45 -0
- metadata +95 -98
- data/lib/blacklight/marc.rb +0 -46
- data/lib/blacklight/marc/citation.rb +0 -251
- data/lib/railties/cucumber.rake +0 -53
- data/lib/railties/rspec.rake +0 -188
- data/spec/helpers/catalog_helper_spec.rb +0 -111
- data/spec/views/catalog/_sms_form.html.erb_spec.rb +0 -19
@@ -0,0 +1,70 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
2
|
+
|
3
|
+
# spec for default partial to display solr document fields
|
4
|
+
# in catalog show view
|
5
|
+
|
6
|
+
describe "/catalog/_show_partials/_default.html.erb" do
|
7
|
+
|
8
|
+
include BlacklightHelper
|
9
|
+
include CatalogHelper
|
10
|
+
|
11
|
+
before(:each) do
|
12
|
+
@fname_1 = Blacklight.config[:show_fields][:field_names].last
|
13
|
+
@fname_2 = "solr_field_not_in_initializer"
|
14
|
+
@fname_3 = Blacklight.config[:show_fields][:field_names][2]
|
15
|
+
@fname_4 = Blacklight.config[:show_fields][:field_names][0]
|
16
|
+
|
17
|
+
@document = mock("solr_doc")
|
18
|
+
@document.should_receive(:get).with(@fname_1, hash_including(:sep => nil)).any_number_of_times.and_return("val_1")
|
19
|
+
@document.should_receive(:get).with(@fname_2, hash_including(:sep => nil)).any_number_of_times.and_return("val_2")
|
20
|
+
@document.should_receive(:get).with(@fname_3, hash_including(:sep => nil)).any_number_of_times.and_return(nil)
|
21
|
+
@document.should_receive(:get).with(@fname_4, hash_including(:sep => nil)).any_number_of_times.and_return("val_4")
|
22
|
+
|
23
|
+
@document.should_receive(:'has?').with(@fname_1).any_number_of_times.and_return(true)
|
24
|
+
@document.should_receive(:'has?').with(@fname_2).any_number_of_times.and_return(true)
|
25
|
+
@document.should_receive(:'has?').with(@fname_3).any_number_of_times.and_return(false)
|
26
|
+
@document.should_receive(:'has?').with(@fname_4).any_number_of_times.and_return(true)
|
27
|
+
@document.should_receive(:'has?').with(anything()).any_number_of_times.and_return(true)
|
28
|
+
|
29
|
+
# cover any remaining fields in initalizer
|
30
|
+
@document.should_receive(:get).with(any_args()).any_number_of_times.and_return("bleah")
|
31
|
+
@document.should_receive(:[]).any_number_of_times
|
32
|
+
|
33
|
+
@flabel_1 = Blacklight.config[:show_fields][:labels][@fname_1]
|
34
|
+
@flabel_3 = Blacklight.config[:show_fields][:labels][@fname_3]
|
35
|
+
@flabel_4 = Blacklight.config[:show_fields][:labels][@fname_4]
|
36
|
+
|
37
|
+
assigns[:document] = @document
|
38
|
+
render_document_partial @document, :show
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should only display fields listed in the initializer" do
|
42
|
+
rendered.should_not include_text("val_2")
|
43
|
+
rendered.should_not include_text(@fname_2)
|
44
|
+
end
|
45
|
+
|
46
|
+
it "should skip over fields listed in initializer that are not in solr response" do
|
47
|
+
rendered.should_not include_text(@fname_3)
|
48
|
+
end
|
49
|
+
|
50
|
+
it "should display field labels from initializer and raw solr field names in the class" do
|
51
|
+
# labels
|
52
|
+
rendered.should include_text(@flabel_1)
|
53
|
+
rendered.should include_text(@flabel_4)
|
54
|
+
# classes
|
55
|
+
rendered.should include_text("blacklight-#{@fname_1}")
|
56
|
+
rendered.should include_text("blacklight-#{@fname_4}")
|
57
|
+
end
|
58
|
+
|
59
|
+
# this test probably belongs in a Cucumber feature
|
60
|
+
# it "should display fields in the order listed in the initializer" do
|
61
|
+
# pending
|
62
|
+
# end
|
63
|
+
|
64
|
+
it "should have values for displayed fields" do
|
65
|
+
rendered.should include_text("val_1")
|
66
|
+
rendered.should include_text("val_4")
|
67
|
+
rendered.should_not include_text("val_2")
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
@@ -0,0 +1,141 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
describe "Atom feed view" do
|
4
|
+
|
5
|
+
|
6
|
+
before(:all) do
|
7
|
+
class AtomMockDocument
|
8
|
+
include Blacklight::Solr::Document
|
9
|
+
end
|
10
|
+
|
11
|
+
AtomMockDocument.field_semantics.merge!(
|
12
|
+
:title => "title_display",
|
13
|
+
:author => "author_display"
|
14
|
+
)
|
15
|
+
AtomMockDocument.extension_parameters[:marc_format_type] = :marc21
|
16
|
+
AtomMockDocument.extension_parameters[:marc_source_field] = :marc_display
|
17
|
+
AtomMockDocument.use_extension( Blacklight::Solr::Document::Marc) do |document|
|
18
|
+
document.key?( :marc_display )
|
19
|
+
end
|
20
|
+
|
21
|
+
# Load sample responses from Solr to a sample request, to test against
|
22
|
+
@data = YAML.load(File.open(File.dirname(__FILE__) +
|
23
|
+
"/../../data/sample_docs.yml"))
|
24
|
+
@rsolr_response = RSolr::Ext::Response::Base.new(@data["solr_response"], nil, @data["params"])
|
25
|
+
@params = @data["params"]
|
26
|
+
@document_list = @data["document_list_mash"].collect do |d|
|
27
|
+
AtomMockDocument.new(d)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
before(:each) do
|
31
|
+
|
32
|
+
# Not sure what Assigns was doing here ... dhf
|
33
|
+
# assigns[:response] = @rsolr_response
|
34
|
+
# assigns[:document_list] = @document_list
|
35
|
+
# not sure why we can't use assigns for 'params', instead this weird way,
|
36
|
+
# but okay.
|
37
|
+
|
38
|
+
params.merge!( @params )
|
39
|
+
@response = @rsolr_response
|
40
|
+
|
41
|
+
# render "catalog/index.atom.builder"
|
42
|
+
# Default behavior in rails 3 is to assume you are rendering a partial,
|
43
|
+
# so you need to be a little more explicit with reder calls outside current scope.
|
44
|
+
render :file => "catalog/index.atom.builder", :content_type => "application/atom+xml", :object => @response
|
45
|
+
|
46
|
+
# We need to use rexml to test certain things that have_tag wont' test
|
47
|
+
# note that response is depricated rails 3, use "redered" instead.
|
48
|
+
@response_xml = REXML::Document.new(rendered)
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should have contextual information" do
|
52
|
+
rendered.should have_selector("link[rel=self]")
|
53
|
+
rendered.should have_selector("link[rel=next]")
|
54
|
+
rendered.should have_selector("link[rel=previous]")
|
55
|
+
rendered.should have_selector("link[rel=first]")
|
56
|
+
rendered.should have_selector("link[rel=last]")
|
57
|
+
rendered.should have_selector("link[rel='alternate'][type='text/html']")
|
58
|
+
rendered.should have_selector("link[rel=search][type='application/opensearchdescription+xml']")
|
59
|
+
end
|
60
|
+
|
61
|
+
it "should get paging data correctly from response" do
|
62
|
+
# Can't use have_tag for namespaced elements, sorry.
|
63
|
+
@response_xml.elements["/feed/opensearch:totalResults"].text.should == "30"
|
64
|
+
@response_xml.elements["/feed/opensearch:startIndex"].text.should == "10"
|
65
|
+
@response_xml.elements["/feed/opensearch:itemsPerPage"].text.should == "10"
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should include an opensearch Query role=request" do
|
69
|
+
|
70
|
+
@response_xml.elements.to_a("/feed/opensearch:itemsPerPage").length.should == 1
|
71
|
+
query_el = @response_xml.elements["/feed/opensearch:Query"]
|
72
|
+
query_el.should_not be_nil
|
73
|
+
query_el.attributes["role"].should == "request"
|
74
|
+
query_el.attributes["searchTerms"].should == ""
|
75
|
+
query_el.attributes["startPage"].should == "2"
|
76
|
+
end
|
77
|
+
|
78
|
+
it "should have ten entries" do
|
79
|
+
rendered.should have_selector("entry", :count => 10)
|
80
|
+
end
|
81
|
+
|
82
|
+
describe "entries" do
|
83
|
+
it "should have a title" do
|
84
|
+
rendered.should have_selector("entry > title")
|
85
|
+
end
|
86
|
+
it "should have an updated" do
|
87
|
+
rendered.should have_selector("entry > updated")
|
88
|
+
end
|
89
|
+
it "should have html link" do
|
90
|
+
rendered.should have_selector("entry > link[rel=alternate][type='text/html']")
|
91
|
+
end
|
92
|
+
it "should have an id" do
|
93
|
+
rendered.should have_selector("entry > id")
|
94
|
+
end
|
95
|
+
it "should have a summary" do
|
96
|
+
rendered.should have_selector("entry > summary")
|
97
|
+
end
|
98
|
+
|
99
|
+
describe "with an author" do
|
100
|
+
before do
|
101
|
+
@entry = @response_xml.elements.to_a("/feed/entry")[0]
|
102
|
+
end
|
103
|
+
it "should have author tag" do
|
104
|
+
@entry.elements["author/name"].should_not be_nil
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
describe "without an author" do
|
109
|
+
before do
|
110
|
+
@entry = @response_xml.elements.to_a("/feed/entry")[1]
|
111
|
+
end
|
112
|
+
it "should not have an author tag" do
|
113
|
+
@entry.elements["author/name"].should be_nil
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
describe "when content_format is specified" do
|
119
|
+
describe "for an entry with content available" do
|
120
|
+
before do
|
121
|
+
@entry = @response_xml.elements.to_a("/feed/entry")[0]
|
122
|
+
end
|
123
|
+
it "should include a link rel tag" do
|
124
|
+
@entry.to_s.should have_selector("link[rel=alternate][type='application/marc']")
|
125
|
+
end
|
126
|
+
it "should have content embedded" do
|
127
|
+
@entry.to_s.should have_selector("content")
|
128
|
+
end
|
129
|
+
end
|
130
|
+
describe "for an entry with NO content available" do
|
131
|
+
before do
|
132
|
+
@entry = @response_xml.elements.to_a("/feed/entry")[5]
|
133
|
+
end
|
134
|
+
it "should include content" do
|
135
|
+
@entry.to_s.should_not have_selector("content[type='application/marc']")
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
|
@@ -0,0 +1,100 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
describe "/catalog/show.html.erb" do
|
4
|
+
|
5
|
+
include Blacklight::SolrHelper
|
6
|
+
|
7
|
+
before(:each) do
|
8
|
+
# get actual solr response
|
9
|
+
all_docs_query = {}
|
10
|
+
(@solr_resp, @document_list) = get_search_results(all_docs_query)
|
11
|
+
@document = @document_list.first
|
12
|
+
adfadf
|
13
|
+
|
14
|
+
|
15
|
+
# TODO: should probably not have id field name hardcoded
|
16
|
+
@div_doc_id = 'div[id=doc_' + @document[:id] + ']'
|
17
|
+
|
18
|
+
assigns[:response] = @solr_resp
|
19
|
+
assigns[:document_list] = @document_list
|
20
|
+
assigns[:document] = @document
|
21
|
+
|
22
|
+
@previousDocument = mock("prev_doc")
|
23
|
+
@previousDocument.should_receive(:[]).with(:id).and_return("abc")
|
24
|
+
@nextDocument = mock("next_doc")
|
25
|
+
@nextDocument.should_receive(:[]).with(:id).and_return("xyz")
|
26
|
+
assigns[:previous_document] = @previousDocument
|
27
|
+
assigns[:next_document] = @nextDocument
|
28
|
+
|
29
|
+
session[:search] = {:q => "query", :f => "facets", :per_page => "10", :page => "2"}
|
30
|
+
render 'catalog/show'
|
31
|
+
end
|
32
|
+
|
33
|
+
html_title_field = Blacklight.config[:show][:html_title]
|
34
|
+
doc_heading_field = Blacklight.config[:show][:heading]
|
35
|
+
# so far, only default display type in plugin
|
36
|
+
display_type_field = Blacklight.config[:show][:display_type]
|
37
|
+
# There is a problem with link_to and rspec-rails. See:
|
38
|
+
# http://www.nabble.com/Rails:-View-specs-and-implicit-parameters-in-link_to()-td20011051.html
|
39
|
+
# This spec will run cleanly if the implicit routes are added to the plugin
|
40
|
+
# level routes.rb file: (at the bottom of the file)
|
41
|
+
#
|
42
|
+
# map.connect ':controller/:action/:id'
|
43
|
+
# map.connect ':controller/:action/:id.:format'
|
44
|
+
|
45
|
+
# If someone can find a better workaround, that would be mega-spiffy. (Cuke anybody?)
|
46
|
+
#
|
47
|
+
# For now, I am commenting out this spec because I'm not sure if adding those
|
48
|
+
# routes will affect anything else. Similar comments are in routes.rb
|
49
|
+
# - Jessie 2009-04-20 (ALSO affects _facets.html.erb_spec.rb)
|
50
|
+
=begin
|
51
|
+
it "should have text for html title field specified in the initializer: " + html_title_field do
|
52
|
+
@document[html_title_field].should_not be_nil
|
53
|
+
end
|
54
|
+
|
55
|
+
it "should have a div containing the document id" do
|
56
|
+
@solr_resp.should have_selector(@div_doc_id)
|
57
|
+
end
|
58
|
+
|
59
|
+
# TODO: re-write this. --bess
|
60
|
+
# TODO: should NOT have h2 hardcoded for document heading field.
|
61
|
+
it "should have an h2 matching contents of heading field specified in the initializer: " + doc_heading_field do
|
62
|
+
@solr_resp.should have_selector(@div_doc_id)
|
63
|
+
with_tag('h2', {:text => @document[doc_heading_field]})
|
64
|
+
end
|
65
|
+
|
66
|
+
# TODO: re-write this. --bess
|
67
|
+
it "should have some displayed field values" do
|
68
|
+
@solr_resp.should have_selector('div[class=row]')
|
69
|
+
with_tag('dt', {:text => /\S+/})
|
70
|
+
with_tag('dd', {:text => /\S+/})
|
71
|
+
end
|
72
|
+
|
73
|
+
|
74
|
+
# Previous and Next Links
|
75
|
+
it "should have previousNextDocument div" do
|
76
|
+
response.should have_selector("div[id=previousNextDocument]")
|
77
|
+
end
|
78
|
+
=end
|
79
|
+
# TODO: tests that need writing?
|
80
|
+
=begin
|
81
|
+
# Previous and Next Links
|
82
|
+
it "should have a next link" do
|
83
|
+
't'.should == 'f'
|
84
|
+
end
|
85
|
+
it "should not have a next link if it's the last document" do
|
86
|
+
't'.should == 'f'
|
87
|
+
end
|
88
|
+
it "should have a previous link" do
|
89
|
+
't'.should == 'f'
|
90
|
+
end
|
91
|
+
it "should not have a previous link if it's the first document" do
|
92
|
+
't'.should == 'f'
|
93
|
+
end
|
94
|
+
|
95
|
+
it "should have a back-to-search-results link" do
|
96
|
+
't'.should == 'f'
|
97
|
+
end
|
98
|
+
=end
|
99
|
+
|
100
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
describe "unAPI formats list" do
|
4
|
+
|
5
|
+
|
6
|
+
before(:all) do
|
7
|
+
class UnapiMockDocument
|
8
|
+
include Blacklight::Solr::Document
|
9
|
+
end
|
10
|
+
module FakeExtension
|
11
|
+
def self.extended(document)
|
12
|
+
document.will_export_as(:mock, "application/mock")
|
13
|
+
end
|
14
|
+
|
15
|
+
def export_as_mock
|
16
|
+
"mock_export"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
UnapiMockDocument.use_extension( FakeExtension )
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should provide a list of object formats which should be supported for all documents" do
|
24
|
+
@export_formats = { :mock => { :content_type => "application/mock" } }
|
25
|
+
render :template => "catalog/unapi.xml.builder", :content_type => "application/mock"
|
26
|
+
h = Hash.from_xml(rendered)
|
27
|
+
|
28
|
+
h['formats'].should_not be_nil
|
29
|
+
h['formats']['format'].should_not be_nil
|
30
|
+
h['formats']['format']['name'].should == 'mock'
|
31
|
+
h['formats']['format']['type'].should == 'application/mock'
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should provide a list of object formats available from the unAPI service for the document" do
|
35
|
+
@document = UnapiMockDocument.new({})
|
36
|
+
@export_formats = @document.export_formats
|
37
|
+
render :template => "catalog/unapi.xml.builder", :content_type => "application/mock"
|
38
|
+
h = Hash.from_xml(rendered)
|
39
|
+
|
40
|
+
h['formats'].should_not be_nil
|
41
|
+
h['formats']['format'].should_not be_nil
|
42
|
+
h['formats']['format']['name'].should == 'mock'
|
43
|
+
h['formats']['format']['type'].should == 'application/mock'
|
44
|
+
end
|
45
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1923831917
|
5
5
|
prerelease: 3
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
9
|
- pre
|
10
|
-
-
|
11
|
-
version: 3.
|
10
|
+
- 2
|
11
|
+
version: 3.0pre2
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- jrochkind
|
@@ -22,7 +22,7 @@ autorequire:
|
|
22
22
|
bindir: bin
|
23
23
|
cert_chain: []
|
24
24
|
|
25
|
-
date: 2011-
|
25
|
+
date: 2011-05-03 00:00:00 -04:00
|
26
26
|
default_executable:
|
27
27
|
dependencies:
|
28
28
|
- !ruby/object:Gem::Dependency
|
@@ -45,14 +45,13 @@ dependencies:
|
|
45
45
|
requirement: &id002 !ruby/object:Gem::Requirement
|
46
46
|
none: false
|
47
47
|
requirements:
|
48
|
-
- -
|
48
|
+
- - ~>
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
hash:
|
50
|
+
hash: 7
|
51
51
|
segments:
|
52
52
|
- 3
|
53
53
|
- 0
|
54
|
-
|
55
|
-
version: 3.0.6
|
54
|
+
version: "3.0"
|
56
55
|
type: :runtime
|
57
56
|
version_requirements: *id002
|
58
57
|
- !ruby/object:Gem::Dependency
|
@@ -241,8 +240,6 @@ files:
|
|
241
240
|
- lib/blacklight/controller.rb
|
242
241
|
- lib/blacklight/engine.rb
|
243
242
|
- lib/blacklight/exceptions.rb
|
244
|
-
- lib/blacklight/marc.rb
|
245
|
-
- lib/blacklight/marc/citation.rb
|
246
243
|
- lib/blacklight/search_fields.rb
|
247
244
|
- lib/blacklight/solr.rb
|
248
245
|
- lib/blacklight/solr/document.rb
|
@@ -256,7 +253,10 @@ files:
|
|
256
253
|
- lib/blacklight/user.rb
|
257
254
|
- lib/blacklight/version.rb
|
258
255
|
- lib/colorize.rb
|
256
|
+
- lib/generators/blacklight/assets_generator.rb
|
259
257
|
- lib/generators/blacklight/blacklight_generator.rb
|
258
|
+
- lib/generators/blacklight/jetty_generator.rb
|
259
|
+
- lib/generators/blacklight/solr_conf_generator.rb
|
260
260
|
- lib/generators/blacklight/templates/SolrMarc.jar
|
261
261
|
- lib/generators/blacklight/templates/catalog_controller.rb
|
262
262
|
- lib/generators/blacklight/templates/config/SolrMarc/config-test.properties
|
@@ -277,15 +277,15 @@ files:
|
|
277
277
|
- lib/generators/blacklight/templates/migrations/create_bookmarks.rb
|
278
278
|
- lib/generators/blacklight/templates/migrations/create_searches.rb
|
279
279
|
- lib/generators/blacklight/templates/migrations/remove_editable_fields_from_bookmarks.rb
|
280
|
-
- lib/generators/blacklight/templates/public/images/
|
281
|
-
- lib/generators/blacklight/templates/public/images/
|
282
|
-
- lib/generators/blacklight/templates/public/images/
|
283
|
-
- lib/generators/blacklight/templates/public/images/
|
284
|
-
- lib/generators/blacklight/templates/public/images/
|
285
|
-
- lib/generators/blacklight/templates/public/images/
|
286
|
-
- lib/generators/blacklight/templates/public/images/
|
287
|
-
- lib/generators/blacklight/templates/public/images/
|
288
|
-
- lib/generators/blacklight/templates/public/images/
|
280
|
+
- lib/generators/blacklight/templates/public/images/bg.png
|
281
|
+
- lib/generators/blacklight/templates/public/images/border.png
|
282
|
+
- lib/generators/blacklight/templates/public/images/bul_sq_gry.gif
|
283
|
+
- lib/generators/blacklight/templates/public/images/checkmark.gif
|
284
|
+
- lib/generators/blacklight/templates/public/images/logo.png
|
285
|
+
- lib/generators/blacklight/templates/public/images/magnifying_glass.gif
|
286
|
+
- lib/generators/blacklight/templates/public/images/remove.gif
|
287
|
+
- lib/generators/blacklight/templates/public/images/separator.gif
|
288
|
+
- lib/generators/blacklight/templates/public/images/start_over.gif
|
289
289
|
- lib/generators/blacklight/templates/public/javascripts/blacklight.js
|
290
290
|
- lib/generators/blacklight/templates/public/javascripts/jquery-1.4.2.min.js
|
291
291
|
- lib/generators/blacklight/templates/public/javascripts/jquery-ui-1.8.1.custom.min.js
|
@@ -306,87 +306,86 @@ files:
|
|
306
306
|
- lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/images/ui-icons_ffffff_256x240.png
|
307
307
|
- lib/generators/blacklight/templates/public/stylesheets/jquery/ui-lightness/jquery-ui-1.8.1.custom.css
|
308
308
|
- lib/generators/blacklight/templates/public/stylesheets/yui.css
|
309
|
+
- lib/generators/blacklight/templates/solr_conf/schema.xml
|
310
|
+
- lib/generators/blacklight/templates/solr_conf/solrconfig.xml
|
309
311
|
- lib/generators/blacklight/templates/solr_document.rb
|
312
|
+
- lib/railties/all_tests.rake
|
310
313
|
- lib/railties/blacklight.rake
|
311
|
-
- lib/railties/
|
312
|
-
- lib/railties/
|
314
|
+
- lib/railties/blacklight_cucumber.rake
|
315
|
+
- lib/railties/blacklight_rspec.rake
|
316
|
+
- lib/railties/jetty_solr_server.rb
|
313
317
|
- lib/railties/solr_marc.rake
|
314
|
-
- lib/railties/test_solr_server.rb
|
315
|
-
- spec/helpers/catalog_helper_spec.rb
|
316
|
-
- spec/views/catalog/_sms_form.html.erb_spec.rb
|
317
318
|
- tasks/blacklight_tasks.rake
|
318
|
-
-
|
319
|
-
-
|
320
|
-
-
|
321
|
-
-
|
322
|
-
-
|
323
|
-
-
|
324
|
-
-
|
325
|
-
-
|
326
|
-
-
|
327
|
-
-
|
328
|
-
-
|
329
|
-
-
|
330
|
-
-
|
331
|
-
-
|
332
|
-
-
|
333
|
-
-
|
334
|
-
-
|
335
|
-
-
|
336
|
-
-
|
337
|
-
-
|
338
|
-
-
|
339
|
-
-
|
340
|
-
-
|
341
|
-
-
|
342
|
-
-
|
343
|
-
-
|
344
|
-
-
|
345
|
-
-
|
346
|
-
-
|
347
|
-
-
|
348
|
-
-
|
349
|
-
-
|
350
|
-
-
|
351
|
-
-
|
352
|
-
-
|
353
|
-
-
|
354
|
-
-
|
355
|
-
-
|
356
|
-
-
|
357
|
-
-
|
358
|
-
-
|
359
|
-
-
|
360
|
-
-
|
361
|
-
-
|
362
|
-
-
|
363
|
-
-
|
364
|
-
-
|
365
|
-
-
|
366
|
-
-
|
367
|
-
-
|
368
|
-
-
|
369
|
-
-
|
370
|
-
-
|
371
|
-
-
|
372
|
-
-
|
373
|
-
-
|
374
|
-
-
|
375
|
-
-
|
376
|
-
-
|
377
|
-
-
|
378
|
-
-
|
379
|
-
-
|
380
|
-
-
|
381
|
-
-
|
382
|
-
-
|
383
|
-
-
|
384
|
-
-
|
385
|
-
-
|
386
|
-
-
|
387
|
-
-
|
388
|
-
- test_app/spec/views/catalog/show.html.erb_spec.rb
|
389
|
-
- test_app/spec/views/catalog/unapi.xml.builder_spec.rb
|
319
|
+
- test_support/.rspec
|
320
|
+
- test_support/data/test_data.utf8.mrc
|
321
|
+
- test_support/features/bookmarks.feature
|
322
|
+
- test_support/features/did_you_mean.feature
|
323
|
+
- test_support/features/folder.feature
|
324
|
+
- test_support/features/librarian_view.feature
|
325
|
+
- test_support/features/record_view.feature
|
326
|
+
- test_support/features/saved_searches.feature
|
327
|
+
- test_support/features/search.feature
|
328
|
+
- test_support/features/search_filters.feature
|
329
|
+
- test_support/features/search_history.feature
|
330
|
+
- test_support/features/search_results.feature
|
331
|
+
- test_support/features/search_sort.feature
|
332
|
+
- test_support/features/step_definitions/bookmarks_steps.rb
|
333
|
+
- test_support/features/step_definitions/error_steps.rb
|
334
|
+
- test_support/features/step_definitions/folder_steps.rb
|
335
|
+
- test_support/features/step_definitions/general_steps.rb
|
336
|
+
- test_support/features/step_definitions/record_view_steps.rb
|
337
|
+
- test_support/features/step_definitions/saved_searches_steps.rb
|
338
|
+
- test_support/features/step_definitions/search_facets_steps.rb
|
339
|
+
- test_support/features/step_definitions/search_history_steps.rb
|
340
|
+
- test_support/features/step_definitions/search_result_steps.rb
|
341
|
+
- test_support/features/step_definitions/search_steps.rb
|
342
|
+
- test_support/features/step_definitions/user_steps.rb
|
343
|
+
- test_support/features/step_definitions/web_steps.rb
|
344
|
+
- test_support/features/support/env.rb
|
345
|
+
- test_support/features/support/paths.rb
|
346
|
+
- test_support/features/support/selectors.rb
|
347
|
+
- test_support/features/unapi.feature
|
348
|
+
- test_support/spec/controllers/application_controller_spec.rb
|
349
|
+
- test_support/spec/controllers/catalog_controller_spec.rb
|
350
|
+
- test_support/spec/controllers/folder_controller_spec.rb
|
351
|
+
- test_support/spec/controllers/search_history_controller_spec.rb
|
352
|
+
- test_support/spec/data/sample_docs.yml
|
353
|
+
- test_support/spec/data/test_data.utf8.mrc
|
354
|
+
- test_support/spec/helpers/blacklight_helper_spec.rb
|
355
|
+
- test_support/spec/helpers/hash_as_hidden_fields_spec.rb
|
356
|
+
- test_support/spec/helpers/render_constraints_helper_spec.rb
|
357
|
+
- test_support/spec/helpers/search_history_helper_spec.rb
|
358
|
+
- test_support/spec/helpers/solr_helper_spec.rb
|
359
|
+
- test_support/spec/lib/blacklight_email_spec.rb
|
360
|
+
- test_support/spec/lib/blacklight_sms_spec.rb
|
361
|
+
- test_support/spec/lib/blacklight_solr_document_dublin_core_spec.rb
|
362
|
+
- test_support/spec/lib/blacklight_solr_document_marc_spec.rb
|
363
|
+
- test_support/spec/lib/blacklight_solr_document_spec.rb
|
364
|
+
- test_support/spec/lib/blacklight_spec.rb
|
365
|
+
- test_support/spec/lib/configurable_spec.rb
|
366
|
+
- test_support/spec/lib/facet_paginator_spec.rb
|
367
|
+
- test_support/spec/lib/marc_export_spec.rb
|
368
|
+
- test_support/spec/lib/search_fields_spec.rb
|
369
|
+
- test_support/spec/lib/tasks/blacklight_task_spec.rb
|
370
|
+
- test_support/spec/lib/tasks/solr_marc_task_spec.rb
|
371
|
+
- test_support/spec/models/bookmark_spec.rb
|
372
|
+
- test_support/spec/models/record_mailer_spec.rb
|
373
|
+
- test_support/spec/models/search_spec.rb
|
374
|
+
- test_support/spec/models/solr_docment_spec.rb
|
375
|
+
- test_support/spec/rcov.opts
|
376
|
+
- test_support/spec/spec.opts
|
377
|
+
- test_support/spec/spec_helper.rb
|
378
|
+
- test_support/spec/support/action_controller.rb
|
379
|
+
- test_support/spec/support/assert_difference.rb
|
380
|
+
- test_support/spec/support/include_text.rb
|
381
|
+
- test_support/spec/views/catalog/_constraints_element.html.erb_spec.rb
|
382
|
+
- test_support/spec/views/catalog/_document_list.html.erb_spec.rb
|
383
|
+
- test_support/spec/views/catalog/_facets.html.erb_spec.rb
|
384
|
+
- test_support/spec/views/catalog/_index_partials/_default.erb_spec.rb
|
385
|
+
- test_support/spec/views/catalog/_show_partials/_default.html.erb_spec.rb
|
386
|
+
- test_support/spec/views/catalog/index.atom.builder_spec.rb
|
387
|
+
- test_support/spec/views/catalog/show.html.erb_spec.rb
|
388
|
+
- test_support/spec/views/catalog/unapi.xml.builder_spec.rb
|
390
389
|
- uninstall.rb
|
391
390
|
has_rdoc: true
|
392
391
|
homepage: http://projectblacklight.org/
|
@@ -427,5 +426,3 @@ summary: A next-geration Library Catalag for Universities
|
|
427
426
|
test_files:
|
428
427
|
- features/generators.feature
|
429
428
|
- features/support/aruba.rb
|
430
|
-
- spec/helpers/catalog_helper_spec.rb
|
431
|
-
- spec/views/catalog/_sms_form.html.erb_spec.rb
|