Apply automatic rubocop fixes
This commit is contained in:
@ -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 ||= {}
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -3,7 +3,6 @@
|
||||
require 'capybara/rspec'
|
||||
|
||||
RSpec.configure do |config|
|
||||
|
||||
config.use_transactional_fixtures = false
|
||||
|
||||
config.before(:suite) do
|
||||
|
@ -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'))
|
||||
|
@ -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)
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'factory_bot'
|
||||
|
||||
# Use "old" FactoryBot default to allow auto-creating associations for #build
|
||||
|
@ -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))
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'capybara/rspec'
|
||||
require 'selenium/webdriver'
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Silencer
|
||||
def silenced
|
||||
@stdout = $stdout
|
||||
|
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WaitForAjax
|
||||
def wait_for_ajax
|
||||
Timeout.timeout(Capybara.default_wait_time) do
|
||||
|
Reference in New Issue
Block a user