Skip to content

Commit 096e861

Browse files
committed
Correct remaining new RuboCop offenses
1 parent f6a142e commit 096e861

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

app/controllers/admin/seo_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ class Admin::SeoController < Admin::BaseController
44
before_action :set_setting
55
before_action :set_section
66

7+
VALID_SECTIONS = %w(general titles permalinks).freeze
8+
79
def show
810
if @setting.permalink_format != "/%year%/%month%/%day%/%title%" &&
911
@setting.permalink_format != "/%year%/%month%/%title%" &&
@@ -37,8 +39,6 @@ def settings_keys
3739
@setting.settings_keys + [:custom_permalink]
3840
end
3941

40-
VALID_SECTIONS = %w(general titles permalinks).freeze
41-
4242
def set_section
4343
section = params[:section]
4444
@section = VALID_SECTIONS.include?(section) ? section : "general"

app/controllers/admin/settings_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# frozen_string_literal: true
22

33
class Admin::SettingsController < Admin::BaseController
4+
VALID_ACTIONS = %w(index write feedback display).freeze
5+
46
def index
57
this_blog.base_url = blog_base_url if this_blog.base_url.blank?
68
load_settings
@@ -33,8 +35,6 @@ def update
3335

3436
private
3537

36-
VALID_ACTIONS = %w(index write feedback display).freeze
37-
3838
def settings_params
3939
@settings_params ||= params.require(:setting).permit(@setting.settings_keys)
4040
end

spec/features/signup_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
scenario "Disallow account sign-up link with a blog setting" do
4848
Blog.first.update(allow_signup: 0)
4949
visit admin_dashboard_path
50+
51+
expect(page).to have_text "You need to sign in or sign up before continuing."
5052
expect(page).not_to have_link I18n.t("accounts.create_account")
5153

5254
visit new_user_registration_path

0 commit comments

Comments
 (0)