Apply automatic rubocop fixes

This commit is contained in:
Sebastian Serth
2021-05-14 10:51:44 +02:00
parent fe4000916c
commit 6cbecb5b39
440 changed files with 2705 additions and 1853 deletions

View File

@ -1,10 +1,11 @@
# frozen_string_literal: true
class AnonymousController < ApplicationController
def flash
@flash ||= {}
end
def redirect_to(*)
end
def redirect_to(*); end
def session
@session ||= {}

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Authentication
def sign_in(user, password)
page.driver.post(sessions_url, email: user.email, password: password)

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
def expect_assigns(pairs)
pairs.each do |key, value|
it "assigns @#{key}" do
@ -61,12 +63,12 @@ end
def obtain_object(object)
case object
when Proc
object.call
when Symbol
send(object)
else
object
when Proc
object.call
when Symbol
send(object)
else
object
end
end
private :obtain_object

View File

@ -3,7 +3,6 @@
require 'capybara/rspec'
RSpec.configure do |config|
config.use_transactional_fixtures = false
config.before(:suite) do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
CONTAINER = Docker::Container.send(:new, Docker::Connection.new('http://example.org', {}), 'id' => SecureRandom.hex)
IMAGE = Docker::Image.new(Docker::Connection.new('http://example.org', {}), 'id' => SecureRandom.hex, 'RepoTags' => [FactoryBot.attributes_for(:ruby)[:docker_image]])
@ -16,7 +18,7 @@ RSpec.configure do |config|
config.after(:suite) do
examples = RSpec.world.filtered_examples.values.flatten
has_docker_tests = examples.any? { |example| example.metadata[:docker] }
has_docker_tests = examples.any? {|example| example.metadata[:docker] }
next unless has_docker_tests
FileUtils.rm_rf(Rails.root.join('tmp', 'files', 'test'))

View File

@ -31,7 +31,7 @@ RSpec::Matchers.define :be_an_equal_exercise_as do |exercise|
return true if object == other # for []
return false if object.length != other.length
object.to_a.product(other.to_a).map { |k, v| equal?(k, v) }.any?
object.to_a.product(other.to_a).map {|k, v| equal?(k, v) }.any?
end
def attributes_and_associations(object)

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'factory_bot'
# Use "old" FactoryBot default to allow auto-creating associations for #build

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
def expect_forbidden_path(path_name)
it "forbids to access the #{path_name.to_s.split('_').join(' ')}" do
visit(send(path_name))

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'capybara/rspec'
require 'selenium/webdriver'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Silencer
def silenced
@stdout = $stdout

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module WaitForAjax
def wait_for_ajax
Timeout.timeout(Capybara.default_wait_time) do