Skip to content

Commit

Permalink
failing test for #label_for_search_field where no search fields are c…
Browse files Browse the repository at this point in the history
…onfigured
  • Loading branch information
mejackreed committed Jan 26, 2018
1 parent 7b84b70 commit 2c5fe3a
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions spec/helpers/configuration_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -272,16 +272,23 @@
end

describe "#label_for_search_field" do
before do
blacklight_config.add_search_field 'title', :qt => 'title_search'
end
context 'with search fields' do
before do
blacklight_config.add_search_field 'title', :qt => 'title_search'
end

it "finds label by key" do
expect(helper.label_for_search_field("title")).to eq "Title"
end
it "finds label by key" do
expect(helper.label_for_search_field("title")).to eq "Title"
end

it "supplies default label for key not found" do
expect(helper.label_for_search_field("non_existent_key")).to eq "Non existent key"
it "supplies default label for key not found" do
expect(helper.label_for_search_field("non_existent_key")).to eq "Non existent key"
end
end
context 'without search fields' do
it "finds label by key" do
expect(helper.label_for_search_field(nil)).to eq "Keyword"
end
end
end
end

0 comments on commit 2c5fe3a

Please sign in to comment.