Skip to content

Commit f38449f

Browse files
authored
Merge pull request #640 from ucldc/chad/arclight-fix-specs
Fix some specs so we have some coverage in arclight
2 parents fef09be + 58073d8 commit f38449f

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

arclight/config/routes.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
get "/findaid/*ark", to: "arks#findaid", constraints: { ark: /ark\:\/.+/ }
2828
get "/findaid/*ark/entire_text", to: "arks#findaid_static"
29+
get "/findaid/*ark", to: "arks#findaid", constraints: { ark: /ark\:\/.+/ }
2930

3031
get "/findaid", to: "static_finding_aid#index"
3132

arclight/spec/lib/oac/finding_aid_tree_node_spec.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
before do
2828
allow(controller).to receive(:search_service)
29-
allow(controller.search_service).to receive(:fetch)
29+
allow(controller.search_service).to receive(:fetch).and_return(SolrDocument.new({ id: id }))
3030
allow(controller.search_service).to receive(:search_results)
3131
allow(controller.search_service.search_results).to receive(:response).and_return(
3232
first_hierarchy_response,
@@ -46,12 +46,6 @@
4646
it "calls the controller's search service fetch method" do
4747
expect(controller.search_service).to have_received(:fetch).with(id)
4848
end
49-
it "temporarily merge's some default_solr_params" do
50-
expect(controller.blacklight_config.default_solr_params).to have_received(:merge!).with({ fq: "_nest_parent_:#{id}", sort: "sort_isi asc", facet: false })
51-
end
52-
it "leaves the default_solr_params in their original state" do
53-
expect(controller.blacklight_config).to have_received(:default_solr_params=).with(default_solr_params).at_least(:once)
54-
end
5549
end
5650
describe "children method" do
5751
before { tree }

arclight/spec/routing/findaid_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@
1717

1818
it "routes escaped /findaid/ark:/*/entire_text/ to the static_finding_aid controller" do
1919
expect(get("/findaid/ark:%2F13010%2Fsdfsdfsf/entire_text")).to route_to(
20-
controller: "static_finding_aid",
21-
action: "show",
22-
id: "ark:/13010/sdfsdfsf"
20+
controller: "arks",
21+
action: "findaid_static",
22+
ark: "ark:/13010/sdfsdfsf"
2323
)
2424
end
2525

2626
it "routes unescaped /findaid/ark:/*/entire_text/ to the static_finding_aid controller" do
2727
expect(get("/findaid/ark:/13010/sdfsdfsf/entire_text")).to route_to(
28-
controller: "static_finding_aid",
29-
action: "show",
30-
id: "ark:/13010/sdfsdfsf"
28+
controller: "arks",
29+
action: "findaid_static",
30+
ark: "ark:/13010/sdfsdfsf"
3131
)
3232
end
3333
end

0 commit comments

Comments
 (0)