Top Level Namespace
Defined Under Namespace
Modules: Refinery
Classes: ApplicationController
Instance Method Summary
collapse
Instance Method Details
#each_run ⇒ Object
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/generators/refinery/engine/templates/spec/spec_helper.rb', line 25
def each_run
Rails.cache.clear
ActiveSupport::Dependencies.clear
FactoryGirl.reload
([Rails.root.to_s] | ::Refinery::Plugins.registered.pathnames).map{|p|
Dir[File.join(p, 'spec', 'support', '**', '*.rb').to_s]
}.flatten.sort.each do |support_file|
require support_file
end
end
|
#setup_environment ⇒ Object
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/generators/refinery/engine/templates/spec/spec_helper.rb', line 1
def setup_environment
ENV["RAILS_ENV"] ||= 'test'
if File.exist?(dummy_path = File.expand_path('../dummy/config/environment.rb', __FILE__))
require dummy_path
elsif File.dirname(__FILE__) =~ %r{vendor/extensions}
require File.expand_path('../../../../../config/environment', __FILE__)
end
require 'rspec/rails'
require 'capybara/rspec'
Rails.backtrace_cleaner.remove_silencers!
RSpec.configure do |config|
config.mock_with :rspec
config.treat_symbols_as_metadata_keys_with_true_values = true
config.filter_run :focus => true
config.run_all_when_everything_filtered = true
end
end
|