OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Add specs to cover the desired behavior of the link in a Meeting page
Aaron Contreras875a4cf84318
diff --git a/modules/meeting/spec/features/meetings_show_spec.rb b/modules/meeting/spec/features/meetings_show_spec.rbindex 8bac19650f0..9011dfb12b2 100644--- a/modules/meeting/spec/features/meetings_show_spec.rb+++ b/modules/meeting/spec/features/meetings_show_spec.rb@@ -57,6 +57,28 @@ RSpec.describe 'Meetings', js: true dotext: 'There is currently nothing to display')end+ context 'with a location' do+ context 'as a valid url' do+ it 'renders a link to the meeting location' do+ show_page.visit!++ show_page.expect_link_to_location(meeting.location)+ end+ end++ context 'as an invalid url' do+ before do+ meeting.update!(location: 'badurl')+ end++ it 'renders the meeting location as plaintext' do+ show_page.visit!++ show_page.expect_plaintext_location(meeting.location)+ end+ end+ end+context 'with an open agenda' dolet!(:agenda) { create(:meeting_agenda, meeting:, text: 'foo') }let(:agenda_update) { create(:meeting_agenda, meeting:, text: 'bla') }diff --git a/modules/meeting/spec/support/pages/meetings/show.rb b/modules/meeting/spec/support/pages/meetings/show.rbindex a52a54b7257..cc87bacd8af 100644--- a/modules/meeting/spec/support/pages/meetings/show.rb+++ b/modules/meeting/spec/support/pages/meetings/show.rb@@ -48,7 +48,7 @@ module Pages::Meetingsdef expect_invited(*users)users.each do |user|- within(".meeting.details") do+ within(meeting_details_container) doexpect(page).to have_link(user.name)end@@ -57,7 +57,7 @@ module Pages::Meetingsdef expect_uninvited(*users)users.each do |user|- within(".meeting.details") do+ within(meeting_details_container) doexpect(page).not_to have_link(user.name)end@@ -69,6 +69,23 @@ module Pages::Meetings.to have_content("Time: #{expected}")end+ def expect_link_to_location(location)+ within(meeting_details_container) do+ expect(page).to have_link location+ end+ end++ def expect_plaintext_location(location)+ within(meeting_details_container) do+ expect(page).not_to have_link location+ expect(page).to have_text(location)+ end+ end++ def meeting_details_container+ find('.meeting.details')+ end+def click_editwithin '.meeting--main-toolbar .toolbar-items' doclick_link 'Edit'