Farmbot-Web-App/spec/spec_helper.rb

47 lines
1.2 KiB
Ruby
Raw Normal View History

ENV['MQTT_HOST'] = "blooper.io"
ENV['OS_UPDATE_SERVER'] = "http://blah.com"
ENV['FW_UPDATE_SERVER'] = "http://test.com"
require 'simplecov'
#Ignore anything with the word 'spec' in it. No need to test your tests.
2014-06-20 19:54:45 -06:00
SimpleCov.start do
add_filter '/spec/'
add_filter 'config/initializers'
end
require 'pry'
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rspec/rails'
2016-11-23 12:30:16 -07:00
require_relative './stuff'
2016-11-09 15:41:10 -07:00
Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
2015-06-10 05:56:35 -06:00
SmarfDoc.config do |c|
c.template_file = 'api_docs.md.erb'
c.output_file = 'api_docs.md'
end
require 'database_cleaner'
DatabaseCleaner.strategy = :truncation
# then, whenever you need to clean the DB
DatabaseCleaner.clean
RSpec.configure do |config|
2016-08-31 12:16:03 -06:00
config.backtrace_exclusion_patterns = [/gems/]
2014-05-08 08:02:51 -06:00
config.include Helpers
2014-06-30 07:19:59 -06:00
config.infer_spec_type_from_file_location!
config.order = 'random'
2014-05-08 08:02:51 -06:00
2016-12-07 09:52:43 -07:00
if ENV['DOCS']
2016-09-20 12:26:05 -06:00
config.before(:each, type: :controller) do
2015-06-10 05:56:35 -06:00
SmarfDoc.run!(request, response)
end
2016-12-07 09:52:43 -07:00
config.after(:suite) do
SmarfDoc.finish!
end
end
end