Skip to content

Commit

Permalink
Move code to new file for improved readability
Browse files Browse the repository at this point in the history
  • Loading branch information
luciagirasoles committed Oct 12, 2023
1 parent e75cb3e commit 86cfff1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
13 changes: 0 additions & 13 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@
abort('The Rails environment is running in production mode!') if Rails.env.production?
require 'rspec/rails'
# Add additional requires below this line. Rails is not loaded until this point!
require 'factory_bot_rails'
require 'rspec/mocks'

# FactoryBot.factories.clear
# FactoryBot.reload
FactoryBot::SyntaxRunner.class_eval { include RSpec::Mocks::ExampleMethods }

# Requires supporting ruby files with custom matchers and macros, etc, in
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
Expand Down Expand Up @@ -71,10 +65,3 @@
# arbitrary gems may also be filtered via:
# config.filter_gems_from_backtrace("gem name")
end

Shoulda::Matchers.configure do |config|
config.integrate do |with|
with.test_framework :rspec
with.library :rails
end
end
7 changes: 7 additions & 0 deletions spec/support/factory_bot.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# frozen_string_literal: true
require 'factory_bot_rails'
require 'rspec/mocks'

RSpec.configure do |config|
config.include FactoryBot::Syntax::Methods
end

FactoryBot::SyntaxRunner.class_eval do
include RSpec::Mocks::ExampleMethods
end
6 changes: 6 additions & 0 deletions spec/support/should_marchers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Shoulda::Matchers.configure do |config|
config.integrate do |with|
with.test_framework :rspec
with.library :rails
end
end

0 comments on commit 86cfff1

Please sign in to comment.