Sha256: f9392af2fd1f2c6216a25075a47e50c99aa5d94b8163b6e98a9754e42b435933

Contents?: true

Size: 1.31 KB

Versions: 2

Compression:

Stored size: 1.31 KB

Contents

Spork.prefork do

  ENV["RAILS_ENV"] = "test"
  require File.expand_path("../dummy/config/environment.rb", __FILE__)
  require 'rspec/rails'
  require 'capybara/rspec'
  require 'capybara/rails'
  require 'machinist/active_record'
  require 'webmock/rspec'

  Rails.backtrace_cleaner.remove_silencers!
  Rails.application.routes.mounted_helpers

  # Load support files
  Dir["#{File.dirname(__FILE__)}/../support/**/*.rb"].each { |f| require f }

  RSpec.configure do |config|
    config.mock_with :rr
    #config.use_transactional_fixtures = true
    config.include Medivo::Engine.routes.url_helpers
    config.before(:each) { Machinist.reset_before_test }
  end

  Capybara.register_driver :selenium_chrome do |app|
    Capybara::Selenium::Driver.new(app, :browser => :chrome)
  end

  class ActiveRecord::Base
    mattr_accessor :shared_connection
    @@shared_connection = nil

    def self.connection
      @@shared_connection || retrieve_connection
    end
  end
end

class String
  def strip_space
    gsub(/\s/, '')
  end
end

ENGINE_PATH = File.expand_path('../..',  __FILE__) unless defined? ENGINE_PATH
Spork.each_run do
  Dir["#{Rails.root}/app/**/*.rb"].each { |f| load f }
  Dir["#{ENGINE_PATH}/app/**/*.rb"].each { |f| load f }
  load "#{ENGINE_PATH}/config/routes.rb"
  load "#{ENGINE_PATH}/spec/support/blueprints.rb"
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
medivo-0.1.0 spec/spec_helper.rb
medivo-0.0.13 spec/spec_helper.rb