diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e4cd54f18..7bbc7c3e3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -26,6 +26,13 @@ def locale_for(type:, term:, record_class:) end def missing_translation(value, _options = {}) - value.include?('translation missing') + case value.class + when FalseClass, NilClass + true + when String + value.include?('translation missing') + else + raise "Unexpected value #{value.inspect}" + end end end diff --git a/spec/presenters/hyku/menu_presenter_spec.rb b/spec/presenters/hyku/menu_presenter_spec.rb index f1555a458..d2ee95ae7 100644 --- a/spec/presenters/hyku/menu_presenter_spec.rb +++ b/spec/presenters/hyku/menu_presenter_spec.rb @@ -125,7 +125,7 @@ let(:id) { "sample_id" } let(:icon_class) { "sample-icon-class" } let(:open) { true } - let(:html_options) { { class: "sample-class", data: { test: "test" } } } + let(:title) { "Cats" } let(:block) { proc { "