Sha256: 7f8adb0ad6bd58dfcdfee6073523f8936e6cf2fbd9d24ed7a9c19657eb11299a
Contents?: true
Size: 880 Bytes
Versions: 14
Compression:
Stored size: 880 Bytes
Contents
ENV['RAILS_ENV'] ||= 'test' require_relative '../config/environment' require 'rails/test_help' module ActiveSupport class TestCase # Run tests in parallel with specified workers parallelize(workers: :number_of_processors) # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. fixtures :all # Add more helper methods to be used by all tests here... def acting_as(user) post login_path, params: { email: user.email, password: 'password' } self end def current_auth SessionGuard.new(name: 'web', session: session) end def assert_authenticated assert is_authenticated, 'The user is not authenticated' end def assert_guest assert_not is_authenticated, 'The user is authenticated' end private def is_authenticated current_auth.check? end end end
Version data entries
14 entries across 14 versions & 1 rubygems