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
Fix specs
Klaus Zanders5cac96b90804
diff --git a/modules/calendar/spec/features/calendar_sharing_spec.rb b/modules/calendar/spec/features/calendar_sharing_spec.rbindex e142de5432a..4afc37d68ac 100644--- a/modules/calendar/spec/features/calendar_sharing_spec.rb+++ b/modules/calendar/spec/features/calendar_sharing_spec.rb@@ -27,7 +27,7 @@#++require 'spec_helper'-require_relative './shared_context'+require_relative 'shared_context'RSpec.describe 'Calendar sharing via ical', js: true doinclude_context 'with calendar full access'@@ -45,6 +45,12 @@ RSpec.describe 'Calendar sharing via ical', js: true doshare_calendars])end+ let(:saved_query) do+ create(:query_with_view_work_packages_calendar,+ user: user_with_sharing_permission,+ project:,+ public: false)+ endlet(:user_without_sharing_permission) do# missing share_calendars permission@@ -66,13 +72,6 @@ RSpec.describe 'Calendar sharing via ical', js: true domember_in_project: project)end- let(:saved_query) do- create(:query_with_view_work_packages_calendar,- user: user_with_sharing_permission,- project:,- public: false)- end-context 'without sufficient permissions and the ical_enabled setting enabled', with_settings: { ical_enabled: true } dolet(:saved_query) docreate(:query_with_view_work_packages_calendar,@@ -108,12 +107,12 @@ RSpec.describe 'Calendar sharing via ical', js: true do# expect disabled sharing menu itemwithin "#settingsDropdown" do- # expect(page).to have_button("Subscribe to iCalendar", disabled: true) # disabled selector not working- expect(page).to have_selector(".menu-item.inactive", text: "Subscribe to iCalendar")- page.click_button("Subscribe to iCalendar")+ # expect(page).to have_button("Subscribe to calendar", disabled: true) # disabled selector not working+ expect(page).to have_selector(".menu-item.inactive", text: "Subscribe to calendar")+ page.click_button("Subscribe to calendar")# modal should not be shown- expect(page).not_to have_selector('.spot-modal--header', text: "Subscribe to iCalendar")+ expect(page).not_to have_selector('.spot-modal--header', text: "Subscribe to calendar")endendend@@ -155,12 +154,12 @@ RSpec.describe 'Calendar sharing via ical', js: true do# expect disabled sharing menu itemwithin "#settingsDropdown" do- # expect(page).to have_button("Subscribe to iCalendar", disabled: true) # disabled selector not working- expect(page).to have_selector(".menu-item.inactive", text: "Subscribe to iCalendar")- page.click_button("Subscribe to iCalendar")+ # expect(page).to have_button("Subscribe to calendar", disabled: true) # disabled selector not working+ expect(page).to have_selector(".menu-item.inactive", text: "Subscribe to calendar")+ page.click_button("Subscribe to calendar")# modal should not be shown- expect(page).not_to have_selector('.spot-modal--header', text: "Subscribe to iCalendar")+ expect(page).not_to have_selector('.spot-modal--header', text: "Subscribe to calendar")endendend@@ -187,35 +186,35 @@ RSpec.describe 'Calendar sharing via ical', js: true do# expect active sharing menu itemwithin "#settingsDropdown" do- expect(page).to have_selector(".menu-item", text: "Subscribe to iCalendar")+ expect(page).to have_selector(".menu-item", text: "Subscribe to calendar")endendit 'shows a sharing modal' doopen_sharing_modal- expect(page).to have_selector('.spot-modal--header', text: "Subscribe to iCalendar")+ expect(page).to have_selector('.spot-modal--header', text: "Subscribe to calendar")endit 'closes the sharing modal when closed by user by clicking the close button' doopen_sharing_modal- expect(page).to have_selector('.spot-modal--header', text: "Subscribe to iCalendar")+ expect(page).to have_selector('.spot-modal--header', text: "Subscribe to calendar")click_button "Cancel"- expect(page).not_to have_selector('.spot-modal--header', text: "Subscribe to iCalendar")+ expect(page).not_to have_selector('.spot-modal--header', text: "Subscribe to calendar")endit 'successfully requests a new tokenized iCalendar URL when a unique name is provided' doopen_sharing_modal- fill_in "Token name", with: "A token name"+ fill_in "Where will you be using this?", with: "A token name"click_button "Copy URL"# implicitly testing for success -> modal is closed and fallback message is shown- expect(page).not_to have_selector('.spot-modal--header', text: "Subscribe to iCalendar")+ expect(page).not_to have_selector('.spot-modal--header', text: "Subscribe to calendar")expect(page).to have_content("/projects/#{saved_query.project.id}/calendars/#{saved_query.id}/ical?ical_token=")# explictly testing for success message is not working in test env, probably@@ -236,30 +235,30 @@ RSpec.describe 'Calendar sharing via ical', js: true doclick_button "Copy URL"# modal is still shown and error message is shown- expect(page).to have_selector('.spot-modal--header', text: "Subscribe to iCalendar")+ expect(page).to have_selector('.spot-modal--header', text: "Subscribe to calendar")expect(page).to have_content("Name is mandatory")endit 'validates the uniqueness of a name' doopen_sharing_modal- fill_in "Token name", with: "A token name"+ fill_in "Where will you be using this?", with: "A token name"click_button "Copy URL"- expect(page).not_to have_selector('.spot-modal--header', text: "Subscribe to iCalendar")+ expect(page).not_to have_selector('.spot-modal--header', text: "Subscribe to calendar")expect(page).to have_content("/projects/#{saved_query.project.id}/calendars/#{saved_query.id}/ical?ical_token=")# do the same thing again, now expect validation erroropen_sharing_modal- fill_in "Token name", with: "A token name" # same name for same user and same query -> not allowed+ fill_in "Where will you be using this?", with: "A token name" # same name for same user and same query -> not allowedclick_button "Copy URL"# modal is still shown and error message is shown- expect(page).to have_selector('.spot-modal--header', text: "Subscribe to iCalendar")+ expect(page).to have_selector('.spot-modal--header', text: "Subscribe to calendar")expect(page).to have_content("Name is already in use")endend@@ -309,12 +308,12 @@ RSpec.describe 'Calendar sharing via ical', js: true do# expect disabled sharing menu itemwithin "#settingsDropdown" do- # expect(page).to have_button("Subscribe to iCalendar", disabled: true) # disabled selector not working- expect(page).to have_selector(".menu-item.inactive", text: "Subscribe to iCalendar")- page.click_button("Subscribe to iCalendar")+ # expect(page).to have_button("Subscribe to calendar", disabled: true) # disabled selector not working+ expect(page).to have_selector(".menu-item.inactive", text: "Subscribe to calendar")+ page.click_button("Subscribe to calendar")# modal should not be shown- expect(page).not_to have_selector('.spot-modal--header', text: "Subscribe to iCalendar")+ expect(page).not_to have_selector('.spot-modal--header', text: "Subscribe to calendar")endendend@@ -330,8 +329,8 @@ RSpec.describe 'Calendar sharing via ical', js: true do# expect disabled sharing menu itemwithin "#settingsDropdown" do- expect(page).to have_selector(".menu-item", text: "Subscribe to iCalendar")- page.click_button("Subscribe to iCalendar")+ expect(page).to have_selector(".menu-item", text: "Subscribe to calendar")+ page.click_button("Subscribe to calendar")endendend