File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
lib/blacklight/access_controls Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ def enforce_show_permissions(_opts = {})
1818
1919 # This will work for BL 6, but will need to move to SearchService in BL 7
2020 def search_builder
21- Blacklight ::AccessControls ::SearchBuilder . new ( self , current_ability )
21+ Blacklight ::AccessControls ::SearchBuilder . new ( self , ability : current_ability )
2222 end
2323 end
2424 end
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
3- describe Blacklight ::AccessControls ::Catalog do
3+ RSpec . describe Blacklight ::AccessControls ::Catalog do
44 let ( :controller ) { CatalogController . new }
55
66 describe '#enforce_show_permissions' do
7- subject { controller . send ( : enforce_show_permissions) }
7+ subject { controller . enforce_show_permissions }
88
99 let ( :params ) { { id : doc . id } }
1010
3838 end
3939 end
4040 end
41+
42+ describe '#search_builder' do
43+ subject { controller . search_builder }
44+
45+ before do
46+ allow ( controller ) . to receive ( :current_ability ) . and_return ( instance_double ( Ability ) )
47+ end
48+
49+ it 'creates a search_builder' do
50+ expect ( subject ) . to be_kind_of Blacklight ::AccessControls ::SearchBuilder
51+ end
52+ end
4153end
You can’t perform that action at this time.
0 commit comments