Remove un-needed action
and template
options to render
in controllers (#28022)
This commit is contained in:
parent
a1636fce7f
commit
291dc04e67
8 changed files with 11 additions and 11 deletions
|
@ -16,7 +16,7 @@ module Admin
|
||||||
@moderation_notes = @account.targeted_moderation_notes.latest
|
@moderation_notes = @account.targeted_moderation_notes.latest
|
||||||
@warnings = @account.strikes.custom.latest
|
@warnings = @account.strikes.custom.latest
|
||||||
|
|
||||||
render template: 'admin/accounts/show'
|
render 'admin/accounts/show'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ module Admin
|
||||||
@relay.enable!
|
@relay.enable!
|
||||||
redirect_to admin_relays_path
|
redirect_to admin_relays_path
|
||||||
else
|
else
|
||||||
render action: :new
|
render :new
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ module Admin
|
||||||
@form = Admin::StatusBatchAction.new
|
@form = Admin::StatusBatchAction.new
|
||||||
@statuses = @report.statuses.with_includes
|
@statuses = @report.statuses.with_includes
|
||||||
|
|
||||||
render template: 'admin/reports/show'
|
render 'admin/reports/show'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ module ChallengableConcern
|
||||||
|
|
||||||
def render_challenge
|
def render_challenge
|
||||||
@body_classes = 'lighter'
|
@body_classes = 'lighter'
|
||||||
render template: 'auth/challenges/new', layout: 'auth'
|
render 'auth/challenges/new', layout: 'auth'
|
||||||
end
|
end
|
||||||
|
|
||||||
def challenge_passed?
|
def challenge_passed?
|
||||||
|
|
|
@ -11,7 +11,7 @@ class Disputes::AppealsController < Disputes::BaseController
|
||||||
redirect_to disputes_strike_path(@strike), notice: I18n.t('disputes.strikes.appealed_msg')
|
redirect_to disputes_strike_path(@strike), notice: I18n.t('disputes.strikes.appealed_msg')
|
||||||
rescue ActiveRecord::RecordInvalid => e
|
rescue ActiveRecord::RecordInvalid => e
|
||||||
@appeal = e.record
|
@appeal = e.record
|
||||||
render template: 'disputes/strikes/show'
|
render 'disputes/strikes/show'
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -25,7 +25,7 @@ class FiltersController < ApplicationController
|
||||||
if @filter.save
|
if @filter.save
|
||||||
redirect_to filters_path
|
redirect_to filters_path
|
||||||
else
|
else
|
||||||
render action: :new
|
render :new
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ class FiltersController < ApplicationController
|
||||||
if @filter.update(resource_params)
|
if @filter.update(resource_params)
|
||||||
redirect_to filters_path
|
redirect_to filters_path
|
||||||
else
|
else
|
||||||
render action: :edit
|
render :edit
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ class StatusesCleanupController < ApplicationController
|
||||||
if @policy.update(resource_params)
|
if @policy.update(resource_params)
|
||||||
redirect_to statuses_cleanup_path, notice: I18n.t('generic.changes_saved_msg')
|
redirect_to statuses_cleanup_path, notice: I18n.t('generic.changes_saved_msg')
|
||||||
else
|
else
|
||||||
render action: :show
|
render :show
|
||||||
end
|
end
|
||||||
rescue ActionController::ParameterMissing
|
rescue ActionController::ParameterMissing
|
||||||
# Do nothing
|
# Do nothing
|
||||||
|
|
|
@ -85,7 +85,7 @@ RSpec.describe ChallengableConcern do
|
||||||
before { get :foo }
|
before { get :foo }
|
||||||
|
|
||||||
it 'renders challenge' do
|
it 'renders challenge' do
|
||||||
expect(response).to render_template('auth/challenges/new')
|
expect(response).to render_template('auth/challenges/new', layout: :auth)
|
||||||
end
|
end
|
||||||
|
|
||||||
# See Auth::ChallengesControllerSpec
|
# See Auth::ChallengesControllerSpec
|
||||||
|
@ -95,7 +95,7 @@ RSpec.describe ChallengableConcern do
|
||||||
before { post :bar }
|
before { post :bar }
|
||||||
|
|
||||||
it 'renders challenge' do
|
it 'renders challenge' do
|
||||||
expect(response).to render_template('auth/challenges/new')
|
expect(response).to render_template('auth/challenges/new', layout: :auth)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'accepts correct password' do
|
it 'accepts correct password' do
|
||||||
|
@ -106,7 +106,7 @@ RSpec.describe ChallengableConcern do
|
||||||
|
|
||||||
it 'rejects wrong password' do
|
it 'rejects wrong password' do
|
||||||
post :bar, params: { form_challenge: { current_password: 'dddfff888123' } }
|
post :bar, params: { form_challenge: { current_password: 'dddfff888123' } }
|
||||||
expect(response.body).to render_template('auth/challenges/new')
|
expect(response.body).to render_template('auth/challenges/new', layout: :auth)
|
||||||
expect(session[:challenge_passed_at]).to be_nil
|
expect(session[:challenge_passed_at]).to be_nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue