Skip to content

Commit

Permalink
Run govuk-lint-ruby -a app lib spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Baines committed May 22, 2018
1 parent 44e8ed6 commit 7da670d
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 33 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin/contact_groups_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Admin::ContactGroupsController < AdminController
before_action :load_contact_group, only: [:edit, :update, :destroy]
before_action :load_contact_group, only: %i[edit update destroy]

def new
@contact_group = ContactGroup.new
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Admin::Contacts::ContactFormLinksController < AdminController
before_action :load_parent_contact
before_action :load_contact_form_link, only: [:edit, :update, :destroy]
before_action :load_contact_form_link, only: %i[edit update destroy]

def new
@contact_form_link = @contact.contact_form_links.build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Admin::Contacts::EmailAddressesController < AdminController
before_action :load_parent_contact
before_action :load_email_address, only: [:edit, :update, :destroy]
before_action :load_email_address, only: %i[edit update destroy]

def new
@email_address = @contact.email_addresses.build
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/contacts/phone_numbers_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Admin::Contacts::PhoneNumbersController < AdminController
before_action :load_parent_contact
before_action :load_phone_number, only: [:edit, :update, :destroy]
before_action :load_phone_number, only: %i[edit update destroy]

def new
@phone_number = @contact.phone_numbers.build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Admin::Contacts::PostAddressesController < AdminController
before_action :load_parent_contact
before_action :load_post_address, only: [:edit, :update, :destroy]
before_action :load_post_address, only: %i[edit update destroy]

def new
@post_address = @contact.post_addresses.build
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/contacts_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Admin::ContactsController < AdminController
before_action :load_contact, only: [:edit, :update, :clone, :destroy]
before_action :load_contact, only: %i[edit update clone destroy]
helper_method :search

def new
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/versioning.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Versioning
extend ActiveSupport::Concern
included do
has_paper_trail ignore: [:updated_at, :created_at]
has_paper_trail ignore: %i[updated_at created_at]
end

def display_versions
Expand Down
3 changes: 1 addition & 2 deletions app/tasks/import_contacts/more_info_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ def render
end

class NullMoreInfoUrl
def to_markdown
end
def to_markdown; end
end

attribute :content, String
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/contacts.rake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace :contacts do
end

desc "Remove a contact and redirect it"
task :remove_with_redirect, [:contact_slug, :redirect_to_location] => :environment do |_task, args|
task :remove_with_redirect, %i[contact_slug redirect_to_location] => :environment do |_task, args|
if args.contact_slug.blank? || args.redirect_to_location.blank?
puts "Usage: rake contacts:remove_with_redirect[contact-to-remove-slug,path-to-redirect-to]"
else
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/update_organisation_slug.rake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
desc "Update an organisation slug"
task :update_organisation_slug, [:old_slug, :new_slug] => :environment do |_task, args|
task :update_organisation_slug, %i[old_slug new_slug] => :environment do |_task, args|
logger = Logger.new(STDOUT)
logger.error("You must specify [old_slug,new_slug]") unless args.old_slug.present? && args.new_slug.present?

Expand Down
3 changes: 1 addition & 2 deletions spec/features/admin/contact_edit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
specify "updating a contact sends the data to the publishing-api" do
update_contact(contact,
title: "new title",
description: "new description"
)
description: "new description")

assert_publishing_api_put_content(contact.content_id, request_json_includes(title: "new title", description: "new description"))
end
Expand Down
3 changes: 1 addition & 2 deletions spec/features/admin/contact_form_link_create_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
create_contact_form_link(contact,
link: contact_form_link.link,
title: contact_form_link.title,
description: contact_form_link.description,
)
description: contact_form_link.description,)

verify contact_form_link_exists(contact, contact_form_link)
end
Expand Down
3 changes: 1 addition & 2 deletions spec/features/admin/email_address_create_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
specify "it can be created" do
create_email_address(contact,
title: email_address.title,
email: email_address.email
)
email: email_address.email)

verify email_address_exists(contact, email_address)
end
Expand Down
3 changes: 1 addition & 2 deletions spec/features/admin/phone_number_create_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
specify "it can be created" do
create_phone_number(contact,
number: number.number,
title: number.title
)
title: number.title)

verify phone_number_exists(contact, number)
end
Expand Down
3 changes: 1 addition & 2 deletions spec/features/admin/post_address_create_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
create_post_address(contact,
title: post_address.title,
street_address: post_address.street_address,
postal_code: post_address.postal_code
)
postal_code: post_address.postal_code)

verify post_address_exists(contact, post_address)
end
Expand Down
13 changes: 1 addition & 12 deletions spec/support/search_api_helpers.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
RSpec.configure do |config|
# rspec-rails 3 will no longer automatically infer an example group's spec type
# from the file location. You can explicitly opt-in to the feature using this
# config option.
# To explicitly tag specs without using automatic inference, set the `:type`
# metadata manually:
#
# describe ThingsController, :type => :controller do
# # Equivalent to being in spec/controllers
# end
config.infer_spec_type_from_file_location!
end
RSpec.configure(&:infer_spec_type_from_file_location!)

0 comments on commit 7da670d

Please sign in to comment.