Skip to content

Commit 511bbb0

Browse files
committed
Creates rspec structure
1 parent 67d5202 commit 511bbb0

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

.rspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--require spec_helper
2+
--format documentation

spec/rails_helper.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
require 'spec_helper'
2+
ENV['RAILS_ENV'] ||= 'test'
3+
require File.expand_path('../../config/environment', __FILE__)
4+
abort("The Rails environment is running in production mode!") if Rails.env.production?
5+
require 'rspec/rails'
6+
7+
begin
8+
ActiveRecord::Migration.maintain_test_schema!
9+
rescue ActiveRecord::PendingMigrationError => e
10+
puts e.to_s.strip
11+
exit 1
12+
end
13+
14+
RSpec.configure do |config|
15+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
16+
17+
config.use_transactional_fixtures = true
18+
19+
config.infer_spec_type_from_file_location!
20+
21+
config.filter_rails_from_backtrace!
22+
end

spec/spec_helper.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
RSpec.configure do |config|
2+
config.expect_with :rspec do |expectations|
3+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
4+
end
5+
6+
config.mock_with :rspec do |mocks|
7+
mocks.verify_partial_doubles = true
8+
end
9+
10+
config.shared_context_metadata_behavior = :apply_to_host_groups
11+
end

0 commit comments

Comments
 (0)