diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b3179681..1c7f5da6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -188,7 +188,8 @@ module ApplicationHelper 'hidden' if Date.today > conference.end_date end - # TODO: Snap!Con: Replace this with a search for a conference logo. + # TODO-SNAPCON: Replace this with a search for a conference logo. + # TODO: If conference is defined, the alt text should be conference name. def nav_root_link_for(conference = nil) path = conference&.id.present? ? conference_path(conference) : root_path link_to( diff --git a/spec/datatables/user_datatable_spec.rb b/spec/datatables/user_datatable_spec.rb index 8ca12e6a..90327233 100644 --- a/spec/datatables/user_datatable_spec.rb +++ b/spec/datatables/user_datatable_spec.rb @@ -8,7 +8,7 @@ describe UserDatatable do end let(:data_cols) do - [:id, :confirmed_at, :email, :name, :attended, :roles, :view_url, :edit_url, :DT_RowId] + [:id, :confirmed_at, :email, :name, :username, :attended, :roles, :view_url, :edit_url, :DT_RowId] end let(:view) do view = double( diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 403c797d..7e209774 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -62,7 +62,7 @@ describe ApplicationHelper, type: :helper do end end - describe 'navigation title link' do + 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') @@ -73,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