2018-05-21 13:43:42 +03:00
$VERBOSE = nil
2017-09-30 07:31:45 +03:00
unless ENV [ 'SKIP_COVERAGE' ]
require 'simplecov'
require 'simplecov-rcov'
2017-06-28 16:21:00 +03:00
2017-09-30 07:31:45 +03:00
SimpleCov . formatters = SimpleCov :: Formatter :: MultiFormatter [ SimpleCov :: Formatter :: HTMLFormatter ,
SimpleCov :: Formatter :: RcovFormatter ]
2017-06-28 16:21:00 +03:00
2017-09-30 07:31:45 +03:00
SimpleCov . start :rails do
add_filter 'init.rb'
root File . expand_path ( File . dirname ( __FILE__ ) + '/..' )
end
2017-06-28 16:21:00 +03:00
end
2017-06-28 17:19:58 +03:00
require File . expand_path ( File . dirname ( __FILE__ ) + '/../../../test/test_helper' )
2018-07-24 17:28:23 +03:00
require File . expand_path ( File . dirname ( __FILE__ ) + '/global_test_helper' )
2017-06-28 17:19:58 +03:00
2018-07-23 18:26:52 +03:00
if defined? ( RSpec )
RSpec . configure do | config |
config . mock_with :mocha
config . example_status_persistence_file_path = Rails . root . join ( 'tmp' , 'additionals_rspec_examples.txt' )
end
end
2017-06-07 20:23:20 +03:00
module Additionals
2018-07-15 19:02:52 +03:00
module TestHelper
2018-07-24 17:28:23 +03:00
include Additionals :: GlobalTestHelper
2016-10-19 14:30:14 +03:00
2018-07-23 19:17:04 +03:00
def prepare_tests
2016-10-19 14:30:14 +03:00
Role . where ( id : [ 1 , 2 ] ) . each do | r |
r . permissions << :view_issues
r . save
end
Project . where ( id : [ 1 , 2 ] ) . each do | project |
EnabledModule . create ( project : project , name : 'issue_tracking' )
end
end
end
2018-07-15 19:02:52 +03:00
2018-07-23 19:17:04 +03:00
class ControllerTest < Redmine :: ControllerTest
include Additionals :: TestHelper
end
class TestCase < ActiveSupport :: TestCase
include Additionals :: TestHelper
end
end