env.rb 531 Bytes
Newer Older
Nihad Abbasov's avatar
Nihad Abbasov committed
1 2
ENV['RAILS_ENV'] = 'test'
require './config/environment'
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
3

Nihad Abbasov's avatar
Nihad Abbasov committed
4 5
require 'rspec'
require 'database_cleaner'
6

7
%w(gitolite_stub login_helpers stubbed_repository valid_commit).each do |f|
8 9 10 11
  require Rails.root.join('spec', 'support', f)
end

include LoginHelpers
12
include GitoliteStub
13

14 15 16
WebMock.allow_net_connect!

DatabaseCleaner.strategy = :truncation
Nihad Abbasov's avatar
Nihad Abbasov committed
17 18
Spinach.hooks.before_scenario { DatabaseCleaner.start }
Spinach.hooks.after_scenario  { DatabaseCleaner.clean }
19 20 21 22 23 24

Spinach.hooks.before_run do
  RSpec::Mocks::setup self

  stub_gitolite!
end