Prefer render responders in settings controllers

This commit is contained in:
Andreas Nedbal 2023-10-20 02:21:52 +02:00
parent 6ff7b08f15
commit 50b925ec48
6 changed files with 8 additions and 8 deletions

View File

@ -19,6 +19,6 @@ class Settings::PrivacyController < ApplicationController
else else
flash[:error] = t(".error") flash[:error] = t(".error")
end end
redirect_to settings_privacy_path render :edit
end end
end end

View File

@ -14,6 +14,6 @@ class Settings::ProfileController < ApplicationController
flash[:error] = t(".error") flash[:error] = t(".error")
end end
redirect_to settings_profile_path render :edit
end end
end end

View File

@ -22,7 +22,7 @@ class Settings::ThemeController < ApplicationController
else else
flash[:error] = t(".error", errors: current_user.theme.errors.messages.flatten.join(" ")) flash[:error] = t(".error", errors: current_user.theme.errors.messages.flatten.join(" "))
end end
redirect_to settings_theme_path render :edit
end end
def destroy def destroy

View File

@ -13,7 +13,7 @@ describe Settings::PrivacyController, type: :controller do
it "renders the edit template" do it "renders the edit template" do
subject subject
expect(response).to render_template("edit") expect(response).to render_template(:edit)
end end
end end
end end
@ -43,7 +43,7 @@ describe Settings::PrivacyController, type: :controller do
it "redirects to the privacy settings page" do it "redirects to the privacy settings page" do
subject subject
expect(response).to redirect_to(:settings_privacy) expect(response).to render_template(:edit)
end end
end end
end end

View File

@ -37,7 +37,7 @@ describe Settings::ProfileController, type: :controller do
it "redirects to the edit_user_profile page" do it "redirects to the edit_user_profile page" do
subject subject
expect(response).to redirect_to(:settings_profile) expect(response).to render_template(:edit)
end end
end end
end end

View File

@ -61,7 +61,7 @@ describe Settings::ThemeController, type: :controller do
it "renders the edit template" do it "renders the edit template" do
subject subject
expect(response).to redirect_to(:settings_theme) expect(response).to render_template(:edit)
end end
end end
@ -75,7 +75,7 @@ describe Settings::ThemeController, type: :controller do
it "renders the edit template" do it "renders the edit template" do
subject subject
expect(response).to redirect_to(:settings_theme) expect(response).to render_template(:edit)
end end
end end
end end