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
Adapt working days spec to use confirmation dialog
Oliver Günther1ee8fdfcb505
diff --git a/spec/features/admin/working_days_spec.rb b/spec/features/admin/working_days_spec.rbindex 4e12616ad76..75e37e591a6 100644--- a/spec/features/admin/working_days_spec.rb+++ b/spec/features/admin/working_days_spec.rb@@ -28,9 +28,10 @@require 'spec_helper'-describe 'Working Days', type: :feature do+describe 'Working Days', type: :feature, js: true doshared_let(:week_days) { week_with_saturday_and_sunday_as_weekend }shared_let(:admin) { create :admin }+ let(:dialog) { ::Components::ConfirmationDialog.new }before dologin_as(admin)@@ -46,12 +47,28 @@ describe 'Working Days', type: :feature doendend+ it 'rejects the updates when cancelling the dialog' do+ expect(Setting.working_days).to eq([1, 2, 3, 4, 5])+ uncheck 'Monday'+ uncheck 'Friday'++ click_on 'Save'++ dialog.cancel+ expect(page).to have_no_selector('.flash.notice')++ expect(Setting.working_days).to eq([1, 2, 3, 4, 5])+ end+it 'updates the values and saves the settings' doexpect(Setting.working_days).to eq([1, 2, 3, 4, 5])uncheck 'Monday'uncheck 'Friday'+click_on 'Save'+ dialog.confirm+expect(page).to have_selector('.flash.notice', text: 'Successful update.')expect(page).to have_unchecked_field 'Monday'expect(page).to have_unchecked_field 'Friday'@@ -60,6 +77,8 @@ describe 'Working Days', type: :feature doexpect(page).to have_checked_field 'Tuesday'expect(page).to have_checked_field 'Wednesday'expect(page).to have_checked_field 'Thursday'++ RequestStore.clear!expect(Setting.working_days).to eq([2, 3, 4])end@@ -72,6 +91,8 @@ describe 'Working Days', type: :feature doclick_on 'Save'+ dialog.confirm+expect(page).to have_selector('.flash.error', text: 'At least one working day needs to be specified.')# Restore the checkboxes to their valid stateexpect(page).to have_checked_field 'Monday'