Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 44 lines (29 sloc) 0.763 kb
3a28dce @svenfuchs try implementing our own Buildable#with_clean_env method which cleans…
svenfuchs authored
1 ENV['RAILS_ENV'] ||= 'test'
3ca2a8c @joshk Updates and cleanups to the tests, mostly the test_helper.
joshk authored
2 require File.expand_path('../../config/environment', __FILE__)
3 require 'rails/test_help'
3a28dce @svenfuchs try implementing our own Buildable#with_clean_env method which cleans…
svenfuchs authored
4
16c7392 @svenfuchs refactoring to flat .travis.yml syntax, also re-introduce test_helper…
svenfuchs authored
5 require 'test_declarative'
6 require 'mocha'
d11a03f @guilleiguaran Use fakeredis for tests
guilleiguaran authored
7 require 'fakeredis'
0a20499 Refactor tests to use single test_helper.
beawesomeinstead authored
8
16c7392 @svenfuchs refactoring to flat .travis.yml syntax, also re-introduce test_helper…
svenfuchs authored
9 require 'travis'
0a20499 Refactor tests to use single test_helper.
beawesomeinstead authored
10
3ca2a8c @joshk Updates and cleanups to the tests, mostly the test_helper.
joshk authored
11 # load all the test helpers
16c7392 @svenfuchs refactoring to flat .travis.yml syntax, also re-introduce test_helper…
svenfuchs authored
12 Dir["#{File.expand_path('../test_helpers/**/*.rb', __FILE__)}"].each do |helper|
13 require helper
721689e @svenfuchs fix unit tests
svenfuchs authored
14 end
15
3ca2a8c @joshk Updates and cleanups to the tests, mostly the test_helper.
joshk authored
16
17 class ActiveSupport::TestCase
18 include TestHelpers::Assertions
19 include TestHelpers::Redis
20
21 DatabaseCleaner.strategy = :truncation
41a3d93 @svenfuchs make Travis::Builder post back configuration instead of running the b…
svenfuchs authored
22
16c7392 @svenfuchs refactoring to flat .travis.yml syntax, also re-introduce test_helper…
svenfuchs authored
23 def setup
a4d59ab @joshk add default timezone to testing helper
joshk authored
24 Time.zone = 'UTC'
25
16c7392 @svenfuchs refactoring to flat .travis.yml syntax, also re-introduce test_helper…
svenfuchs authored
26 Mocha::Mockery.instance.verify
3ca2a8c @joshk Updates and cleanups to the tests, mostly the test_helper.
joshk authored
27
28 Travis.pusher = TestHelpers::Mocks::Pusher.new
29 Resque.redis = FakeRedis::Redis.new
30
31 DatabaseCleaner.start
32
33 super
41a3d93 @svenfuchs make Travis::Builder post back configuration instead of running the b…
svenfuchs authored
34 end
35
3ca2a8c @joshk Updates and cleanups to the tests, mostly the test_helper.
joshk authored
36 def teardown
37 Travis.pusher = nil
38
39 DatabaseCleaner.clean
40
41 super
42 end
43 end
Something went wrong with that request. Please try again.