summaryrefslogtreecommitdiff
path: root/features/support/env.rb
blob: 7bd89801da194963a210c82a0d1ca56f73cba2ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
ENV['RAILS_ENV'] = 'test'
require './config/environment'

require 'rspec'
require 'database_cleaner'
require 'spinach/capybara'

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

include LoginHelpers
include GitoliteStub

WebMock.allow_net_connect!
Capybara.javascript_driver = :webkit

DatabaseCleaner.strategy = :truncation
Spinach.hooks.before_scenario { DatabaseCleaner.start }
Spinach.hooks.after_scenario  { DatabaseCleaner.clean }

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

  stub_gitolite!
end