initial commit

This commit is contained in:
Alex Turchyn
2023-05-21 17:59:36 +03:00
commit 97c462ead2
159 changed files with 10987 additions and 0 deletions
@@ -0,0 +1,7 @@
# frozen_string_literal: true
class UserMailerPreview < ActionMailer::Preview
def invitation_email
UserMailer.invitation_email(User.last)
end
end
+56
View File
@@ -0,0 +1,56 @@
# frozen_string_literal: true
require 'spec_helper'
ENV['RAILS_ENV'] ||= 'test'
ENV['TZ'] ||= 'UTC'
require_relative '../config/environment'
abort('The Rails environment is running in production mode!') if Rails.env.production?
require 'rspec/rails'
require 'capybara/cuprite'
require 'webmock/rspec'
WebMock.disable_net_connect!(allow_localhost: true)
require 'simplecov' if ENV['COVERAGE']
Capybara.server = :puma, { Silent: true }
Capybara.disable_animation = true
Capybara.register_driver(:headless_cuprite) do |app|
Capybara::Cuprite::Driver.new(app, window_size: [1200, 800],
process_timeout: 20,
timeout: 20,
js_errors: true)
end
Capybara.register_driver(:headful_cuprite) do |app|
Capybara::Cuprite::Driver.new(app, window_size: [1200, 800],
headless: false,
process_timeout: 20,
timeout: 20,
js_errors: true)
end
Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
begin
ActiveRecord::Migration.maintain_test_schema!
rescue ActiveRecord::PendingMigrationError => e
abort e.to_s.strip
end
RSpec.configure do |config|
config.use_transactional_fixtures = true
config.infer_spec_type_from_file_location!
config.filter_rails_from_backtrace!
config.include FactoryBot::Syntax::Methods
config.before(:each, type: :system) do
if ENV['HEADLESS'] == 'false'
driven_by :headful_cuprite
else
driven_by :headless_cuprite
end
end
end
+13
View File
@@ -0,0 +1,13 @@
# frozen_string_literal: true
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
config.shared_context_metadata_behavior = :apply_to_host_groups
end