Actualizar plugin Additionals a 3.0.0
This commit is contained in:
parent
3d976f1b3b
commit
a26f5567af
399 changed files with 70374 additions and 4093 deletions
|
@ -1,27 +1,15 @@
|
|||
$VERBOSE = nil
|
||||
|
||||
unless ENV['SKIP_COVERAGE']
|
||||
if ENV['JENKINS']
|
||||
require 'simplecov'
|
||||
require 'simplecov-rcov'
|
||||
|
||||
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter[SimpleCov::Formatter::HTMLFormatter,
|
||||
SimpleCov::Formatter::RcovFormatter]
|
||||
|
||||
SimpleCov.start :rails do
|
||||
add_filter 'init.rb'
|
||||
root File.expand_path(File.dirname(__FILE__) + '/..')
|
||||
root File.expand_path "#{File.dirname __FILE__}/.."
|
||||
end
|
||||
end
|
||||
|
||||
require File.expand_path(File.dirname(__FILE__) + '/../../../test/test_helper')
|
||||
require File.expand_path(File.dirname(__FILE__) + '/global_test_helper')
|
||||
|
||||
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
|
||||
require File.expand_path "#{File.dirname __FILE__}/../../../test/test_helper"
|
||||
require File.expand_path "#{File.dirname __FILE__}/global_test_helper"
|
||||
|
||||
module Additionals
|
||||
module TestHelper
|
||||
|
@ -29,21 +17,43 @@ module Additionals
|
|||
|
||||
def prepare_tests
|
||||
Role.where(id: [1, 2]).each do |r|
|
||||
r.permissions << :view_issues
|
||||
r.permissions << :save_dashboards
|
||||
r.save
|
||||
end
|
||||
|
||||
Role.where(id: [1]).each do |r|
|
||||
r.permissions << :share_dashboards
|
||||
r.permissions << :set_system_dashboards
|
||||
r.save
|
||||
end
|
||||
|
||||
Project.where(id: [1, 2]).each do |project|
|
||||
EnabledModule.create(project: project, name: 'issue_tracking')
|
||||
EnabledModule.create project: project, name: 'issue_tracking'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
module PluginFixturesLoader
|
||||
def fixtures(*table_names)
|
||||
dir = "#{File.dirname __FILE__}/fixtures/"
|
||||
table_names.each do |x|
|
||||
ActiveRecord::FixtureSet.create_fixtures(dir, x) if File.exist?("#{dir}/#{x}.yml")
|
||||
end
|
||||
super(table_names)
|
||||
end
|
||||
end
|
||||
|
||||
class ControllerTest < Redmine::ControllerTest
|
||||
include Additionals::TestHelper
|
||||
extend PluginFixturesLoader
|
||||
end
|
||||
|
||||
class TestCase < ActiveSupport::TestCase
|
||||
include Additionals::TestHelper
|
||||
extend PluginFixturesLoader
|
||||
end
|
||||
|
||||
class IntegrationTest < Redmine::IntegrationTest
|
||||
extend PluginFixturesLoader
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue