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
Provide direction of redirect in spec
Oliver Günther83a173071225
diff --git a/app/controllers/custom_styles_controller.rb b/app/controllers/custom_styles_controller.rbindex 0a94bd3c028..63d4f4b6606 100644--- a/app/controllers/custom_styles_controller.rb+++ b/app/controllers/custom_styles_controller.rb@@ -66,7 +66,7 @@ class CustomStylesController < ApplicationControllerredirect_to custom_style_pathelseflash[:error] = @custom_style.errors.full_messages- render action: :show+ render action: :show, status: :unprocessable_entityendend@@ -76,7 +76,7 @@ class CustomStylesController < ApplicationControllerredirect_to custom_style_pathelseflash[:error] = @custom_style.errors.full_messages- render action: :show+ render action: :show, status: :unprocessable_entityendend@@ -208,6 +208,7 @@ class CustomStylesController < ApplicationControllerif @custom_style.nil?return render_404end+@custom_style.send(remove_method)redirect_to custom_style_pathenddiff --git a/spec/controllers/custom_styles_controller_spec.rb b/spec/controllers/custom_styles_controller_spec.rbindex 51f49e52371..e7da4876c32 100644--- a/spec/controllers/custom_styles_controller_spec.rb+++ b/spec/controllers/custom_styles_controller_spec.rb@@ -42,7 +42,6 @@ RSpec.describe CustomStylesController docontext "when active token exists", with_ee: %i[define_custom_style] doit "renders show" doexpect(subject).to redirect_to action: :show, tab: "interface"- expect(response).to be_redirectendend@@ -85,7 +84,7 @@ RSpec.describe CustomStylesController dolet(:valid) { true }it "redirects to show" do- expect(response).to be_redirect+ expect(response).to redirect_to action: :showexpect(response).to have_http_status(:found)endend@@ -94,7 +93,7 @@ RSpec.describe CustomStylesController dolet(:valid) { false }it "renders with error" do- expect(response).not_to be_redirect+ expect(response).to have_http_status(:unprocessable_entity)expect(response).to render_template "custom_styles/show"endend@@ -120,8 +119,7 @@ RSpec.describe CustomStylesController dolet(:valid) { true }it "redirects to show" do- expect(response).to be_redirect- expect(response).to have_http_status(:found)+ expect(response).to redirect_to(action: :show)endend@@ -129,7 +127,7 @@ RSpec.describe CustomStylesController dolet(:valid) { false }it "renders with error" do- expect(response).not_to be_redirect+ expect(response).to have_http_status(:unprocessable_entity)expect(response).to render_template "custom_styles/show"endend@@ -147,8 +145,7 @@ RSpec.describe CustomStylesController dolet(:valid) { true }it "redirects to show" do- expect(response).to be_redirect- expect(response).to have_http_status(:found)+ expect(response).to redirect_to(action: :show)endend@@ -156,7 +153,7 @@ RSpec.describe CustomStylesController dolet(:valid) { false }it "renders with error" do- expect(response).not_to be_redirect+ expect(response).to have_http_status(:unprocessable_entity)expect(response).to render_template "custom_styles/show"endend@@ -208,7 +205,7 @@ RSpec.describe CustomStylesController doendit "removes the logo from custom_style" do- expect(response).to be_redirect+ expect(response).to redirect_to(action: :show)expect(response).to have_http_status(:found)endend@@ -270,8 +267,7 @@ RSpec.describe CustomStylesController doendit "removes the export logo from custom_style" do- expect(response).to be_redirect- expect(response).to have_http_status(:found)+ expect(response).to redirect_to(action: :show)endend@@ -331,8 +327,7 @@ RSpec.describe CustomStylesController doendit "removes the export cover from custom_style" do- expect(response).to be_redirect- expect(response).to have_http_status(:found)+ expect(response).to redirect_to(action: :show)endend@@ -393,8 +388,7 @@ RSpec.describe CustomStylesController doendit "removes the favicon from custom_style" do- expect(response).to be_redirect- expect(response).to have_http_status(:found)+ expect(response).to redirect_to(action: :show)endend@@ -455,8 +449,7 @@ RSpec.describe CustomStylesController doendit "removes the touch icon from custom_style" do- expect(response).to be_redirect- expect(response).to have_http_status(:found)+ expect(response).to redirect_to(action: :show)endend@@ -492,8 +485,7 @@ RSpec.describe CustomStylesController doit "saves the color" doexpect(custom_style.export_cover_text_color).to eq("#990000")- expect(response).to be_redirect- expect(response).to have_http_status(:found)+ expect(response).to redirect_to(action: :show)endend@@ -510,8 +502,7 @@ RSpec.describe CustomStylesController doit "removes the color" doexpect(custom_style.export_cover_text_color).to be_nil- expect(response).to be_redirect- expect(response).to have_http_status(:found)+ expect(response).to redirect_to(action: :show)endend@@ -526,8 +517,7 @@ RSpec.describe CustomStylesController doit "ignores the parameter" doexpect(custom_style.export_cover_text_color).to be_nil- expect(response).to be_redirect- expect(response).to have_http_status(:found)+ expect(response).to redirect_to(action: :show)endendend@@ -539,8 +529,7 @@ RSpec.describe CustomStylesController doendit "is created" do- expect(response).to be_redirect- expect(response).to have_http_status(:found)+ expect(response).to redirect_to(action: :show)endendend