We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c886fa commit df28fafCopy full SHA for df28faf
app/helpers/application_helper.rb
@@ -1,6 +1,6 @@
1
module ApplicationHelper
2
def tacos_enabled?
3
- ENV.fetch('TACOS_URL', false)
+ ENV.fetch('TACOS_URL', '').length > 0
4
end
5
module_function :tacos_enabled?
6
test/helpers/application_helper_test.rb
@@ -3,6 +3,16 @@
class ApplicationHelperTest < ActionView::TestCase
include ApplicationHelper
+ test 'tacos_enabled? requires TACOS_URL env variable to have non-zero length' do
7
+ ClimateControl.modify TACOS_URL: 'foo' do
8
+ assert_equal true, tacos_enabled?
9
+ end
10
+
11
+ ClimateControl.modify TACOS_URL: '' do
12
+ assert_equal false, tacos_enabled?
13
14
15
16
test 'index_page_title renders as expected' do
17
assert_equal 'Search | MIT Libraries', index_page_title
18
0 commit comments