From c170221605e6921145088ee62e595a60fd7c9d68 Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Wed, 24 Feb 2021 20:10:05 -0800 Subject: [PATCH] More image/nav tests --- spec/helpers/application_helper_spec.rb | 26 ++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 759a8113..7e209774 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -62,12 +62,7 @@ describe ApplicationHelper, type: :helper do end end - describe 'navigation title link' do - it 'should default to OSEM' do - ENV.delete('OSEM_NAME') - expect(nav_link_text(nil)).to match 'OSEM' - end - + describe 'navigation image link' do it 'should default to OSEM' do ENV.delete('OSEM_NAME') expect(nav_root_link_for(nil)).to include image_tag('snapcon_logo.png', alt: 'OSEM') @@ -78,8 +73,25 @@ describe ApplicationHelper, type: :helper do expect(nav_root_link_for(nil)).to include image_tag('snapcon_logo.png', alt: ENV['OSEM_NAME']) end + # TODO-SNAPCON: This is an indicator in a conference it should be the conference name. it 'should use the conference organization name' do - expect(nav_root_link_for(nil)).to include image_tag('snapcon_logo.png', alt: conference.title) + expect(nav_root_link_for(nil)).to include image_tag('snapcon_logo.png', alt: conference.organization.name) + end + end + + describe 'navigation link titke text' do + it 'should default to OSEM' do + ENV.delete('OSEM_NAME') + expect(nav_link_text(nil)).to match 'OSEM' + end + + it 'should use the environment variable' do + ENV['OSEM_NAME'] = Faker::Company.name + "'" + expect(nav_link_text(nil)).to match ENV['OSEM_NAME'] + end + + it 'should use the conference organization name' do + expect(nav_link_text(nil)).to match conference.organization.name) end end end