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 `calendars#new` and `calendars#create` routes
Aaron Contrerasc8571124e109
diff --git a/modules/calendar/app/controllers/calendar/calendars_controller.rb b/modules/calendar/app/controllers/calendar/calendars_controller.rbindex 7b117921ca4..d1ace74b6ab 100644--- a/modules/calendar/app/controllers/calendar/calendars_controller.rb+++ b/modules/calendar/app/controllers/calendar/calendars_controller.rb@@ -48,6 +48,10 @@ module ::Calendarrender layout: 'angular/angular'end+ def new; end++ def create; end+def destroyif @view.destroyflash[:notice] = t(:notice_successful_delete)diff --git a/modules/calendar/config/routes.rb b/modules/calendar/config/routes.rbindex 993b095367b..4f9a7307c19 100644--- a/modules/calendar/config/routes.rb+++ b/modules/calendar/config/routes.rb@@ -10,5 +10,5 @@ OpenProject::Application.routes.draw doendend- resources :calendars, only: :index, controller: 'calendar/calendars'+ resources :calendars, only: %i[index new create], controller: 'calendar/calendars'enddiff --git a/modules/calendar/spec/routing/calendar_routing_spec.rb b/modules/calendar/spec/routing/calendar_routing_spec.rbindex 3bbd6347ee9..6a82bac7da2 100644--- a/modules/calendar/spec/routing/calendar_routing_spec.rb+++ b/modules/calendar/spec/routing/calendar_routing_spec.rb@@ -47,6 +47,16 @@ RSpec.describe Calendar::CalendarsController doproject_id: '1')end+ it do+ expect(get('/calendars/new')).to route_to(controller: 'calendar/calendars',+ action: 'new')+ end++ it do+ expect(post('/calendars')).to route_to(controller: 'calendar/calendars',+ action: 'create')+ end+it doexpect(delete('/projects/1/calendars/2')).to route_to(controller: 'calendar/calendars',action: 'destroy',