spec/helpers/configuration_helper_spec.rb in blacklight-5.10.3 vs spec/helpers/configuration_helper_spec.rb in blacklight-5.11.0

- old
+ new

@@ -135,10 +135,19 @@ allow(helper).to receive(:field_label).with(:"blacklight.search.fields.facet.my_field", :"blacklight.search.fields.my_field", "some label", "My field") helper.facet_field_label "my_field" end end + describe "#view_label" do + it "should look up the label to display for the view" do + allow(blacklight_config).to receive(:view).and_return({ "my_view" => double(label: "some label", title: nil) }) + allow(helper).to receive(:field_label).with(:"blacklight.search.view_title.my_view", :"blacklight.search.view.my_view", "some label", nil, "My view") + + helper.view_label "my_view" + end + end + describe "#field_label" do it "should look up the label as an i18n string" do allow(helper).to receive(:t).with(:some_key, default: []).and_return "my label" label = helper.field_label :some_key @@ -147,16 +156,9 @@ it "should pass the provided i18n keys to I18n.t" do allow(helper).to receive(:t).with(:key_a, default: [:key_b, "default text"]) label = helper.field_label :key_a, :key_b, "default text" - end - - it "should compact nil keys (fixes rails/rails#19419)" do - allow(helper).to receive(:t).with(:key_a, default: [:key_b]) - - label = helper.field_label :key_a, nil, :key_b - end end describe "#default_per_page" do it "should be the configured default per page" do