mirror of
https://github.com/anteo/redmine_custom_workflows.git
synced 2026-01-25 15:54:19 +00:00
fixtures :all
This commit is contained in:
parent
5cae951d24
commit
6bf436f19f
@ -24,8 +24,7 @@ AllCops:
|
||||
Exclude:
|
||||
- '**/vendor/**/*'
|
||||
|
||||
# Enable extensions
|
||||
require:
|
||||
plugins:
|
||||
- rubocop-performance
|
||||
- rubocop-rails
|
||||
|
||||
|
||||
@ -21,8 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# Attachment controller patch test
|
||||
class AttachmentsControllerPatchTest < RedmineCustomWorkflows::Test::TestCase
|
||||
fixtures :attachments, :enabled_modules, :custom_workflows, :custom_workflows_projects,
|
||||
:roles, :members, :member_roles
|
||||
|
||||
def setup
|
||||
super
|
||||
|
||||
@ -21,7 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# Custom workflows controller test
|
||||
class CustomWorkflowsControllerTest < RedmineCustomWorkflows::Test::TestCase
|
||||
fixtures :custom_workflows
|
||||
|
||||
def setup
|
||||
super
|
||||
|
||||
@ -22,7 +22,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
# Group controller patch test
|
||||
class GroupControllerPatchTest < RedmineCustomWorkflows::Test::TestCase
|
||||
include Rails.application.routes.url_helpers
|
||||
fixtures :custom_workflows, :custom_workflows_projects
|
||||
|
||||
def setup
|
||||
super
|
||||
|
||||
@ -21,9 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# Issue relation controller patch test
|
||||
class IssueRelationsControllerPatchTest < RedmineCustomWorkflows::Test::TestCase
|
||||
fixtures :user_preferences, :issues, :versions, :trackers, :projects_trackers, :issue_statuses,
|
||||
:enabled_modules, :enumerations, :issue_categories, :custom_workflows, :custom_workflows_projects,
|
||||
:issue_relations, :roles, :members, :member_roles, :attachments
|
||||
|
||||
def setup
|
||||
super
|
||||
|
||||
@ -21,9 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# Issue controller patch test
|
||||
class IssuesControllerPatchTest < RedmineCustomWorkflows::Test::TestCase
|
||||
fixtures :user_preferences, :issues, :versions, :trackers, :projects_trackers, :issue_statuses,
|
||||
:enabled_modules, :enumerations, :issue_categories, :custom_workflows, :custom_workflows_projects, :roles,
|
||||
:members, :member_roles
|
||||
|
||||
def setup
|
||||
super
|
||||
|
||||
@ -21,7 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# Users controller patch test
|
||||
class MembersControllerPatchTest < RedmineCustomWorkflows::Test::TestCase
|
||||
fixtures :user_preferences, :roles, :members, :member_roles, :custom_workflows, :custom_workflows_projects
|
||||
|
||||
def setup
|
||||
super
|
||||
|
||||
@ -21,8 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# Project controller patch test
|
||||
class ProjectsControllerPatchTest < RedmineCustomWorkflows::Test::TestCase
|
||||
fixtures :user_preferences, :issues, :versions, :trackers, :projects_trackers, :enabled_modules,
|
||||
:enumerations, :custom_workflows, :custom_workflows_projects, :roles, :members, :member_roles
|
||||
|
||||
def setup
|
||||
super
|
||||
|
||||
@ -21,9 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# Time controller patch test
|
||||
class TimelogControllerPatchTest < RedmineCustomWorkflows::Test::TestCase
|
||||
fixtures :user_preferences, :issues, :versions, :trackers, :projects_trackers, :issue_statuses,
|
||||
:enabled_modules, :enumerations, :issue_categories, :custom_workflows, :custom_workflows_projects,
|
||||
:time_entries, :roles, :members, :member_roles
|
||||
|
||||
def setup
|
||||
super
|
||||
|
||||
@ -21,7 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# Users controller patch test
|
||||
class UsersControllerPatchTest < RedmineCustomWorkflows::Test::TestCase
|
||||
fixtures :custom_workflows, :custom_workflows_projects
|
||||
|
||||
def setup
|
||||
super
|
||||
|
||||
@ -21,7 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# Version controller patch test
|
||||
class VersionsControllerPatchTest < RedmineCustomWorkflows::Test::TestCase
|
||||
fixtures :versions, :custom_workflows, :custom_workflows_projects, :roles, :members, :member_roles
|
||||
|
||||
def setup
|
||||
super
|
||||
|
||||
@ -21,9 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# Wiki controller patch test
|
||||
class WikiControllerPatchTest < RedmineCustomWorkflows::Test::TestCase
|
||||
fixtures :user_preferences, :issues, :versions, :trackers, :projects_trackers, :enabled_modules,
|
||||
:enumerations, :wikis, :wiki_pages, :wiki_contents, :custom_workflows, :custom_workflows_projects,
|
||||
:roles, :members, :member_roles
|
||||
|
||||
def setup
|
||||
super
|
||||
|
||||
@ -21,22 +21,16 @@ module RedmineCustomWorkflows
|
||||
module Test
|
||||
# Test case base class
|
||||
class TestCase < ActionDispatch::IntegrationTest
|
||||
fixtures :users, :email_addresses, :projects
|
||||
|
||||
# Allow us to override the fixtures method to implement fixtures for our plugin.
|
||||
# Ultimately it allows for better integration without blowing redmine fixtures up,
|
||||
# and allowing us to suppliment redmine fixtures if we need to.
|
||||
def self.fixtures(*table_names)
|
||||
def initialize(name)
|
||||
super(name)
|
||||
# Load all plugin's fixtures
|
||||
dir = File.join(File.dirname(__FILE__), 'fixtures')
|
||||
redmine_table_names = []
|
||||
table_names.each do |x|
|
||||
if File.exist?(File.join(dir, "#{x}.yml"))
|
||||
ActiveRecord::FixtureSet.create_fixtures(dir, x)
|
||||
else
|
||||
redmine_table_names << x
|
||||
end
|
||||
ext = '.yml'
|
||||
Dir.glob("#{dir}/**/*#{ext}").each do |file|
|
||||
fixture = File.basename(file, ext)
|
||||
ActiveRecord::FixtureSet.create_fixtures dir, fixture
|
||||
end
|
||||
super(redmine_table_names) if redmine_table_names.any?
|
||||
end
|
||||
|
||||
def setup
|
||||
|
||||
@ -21,7 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# Attachment patch test class
|
||||
class AttachmentPatchTest < RedmineCustomWorkflows::Test::UnitTest
|
||||
fixtures :attachments
|
||||
|
||||
def setup
|
||||
@attachment1 = Attachment.find 1
|
||||
|
||||
@ -22,7 +22,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
# Custom mailer test class
|
||||
class CustomWorkflowMailerTest < RedmineCustomWorkflows::Test::UnitTest
|
||||
include Redmine::I18n
|
||||
fixtures :users, :email_addresses
|
||||
|
||||
def setup
|
||||
@user2 = User.find 2
|
||||
|
||||
@ -21,7 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# Custom workflow test class
|
||||
class CustomWorkflowTest < RedmineCustomWorkflows::Test::UnitTest
|
||||
fixtures :projects, :custom_workflows, :custom_workflows_projects
|
||||
|
||||
def setup
|
||||
@cw1 = CustomWorkflow.find 1
|
||||
|
||||
@ -21,7 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# Group patch test class
|
||||
class GroupPatchTest < RedmineCustomWorkflows::Test::UnitTest
|
||||
fixtures :users
|
||||
|
||||
def setup
|
||||
@group10 = Group.find 10
|
||||
|
||||
@ -21,7 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# Issue patch test class
|
||||
class IssuePatchTest < RedmineCustomWorkflows::Test::UnitTest
|
||||
fixtures :issues
|
||||
|
||||
def setup
|
||||
@issue1 = Issue.find 1
|
||||
|
||||
@ -21,7 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# Issue relation patch test class
|
||||
class IssueRelationPatchTest < RedmineCustomWorkflows::Test::UnitTest
|
||||
fixtures :issue_relations
|
||||
|
||||
def setup
|
||||
@issue_relation1 = IssueRelation.find 1
|
||||
|
||||
@ -21,7 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# Member patch test class
|
||||
class MemberPatchTest < RedmineCustomWorkflows::Test::UnitTest
|
||||
fixtures :members
|
||||
|
||||
def setup
|
||||
@member1 = Member.find 1
|
||||
|
||||
@ -21,7 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# Project patch test class
|
||||
class ProjectPatchTest < RedmineCustomWorkflows::Test::UnitTest
|
||||
fixtures :projects
|
||||
|
||||
def setup
|
||||
@project1 = Project.find 1
|
||||
|
||||
@ -21,7 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# Time entry patch test class
|
||||
class TimeEntryPatchTest < RedmineCustomWorkflows::Test::UnitTest
|
||||
fixtures :time_entries
|
||||
|
||||
def setup
|
||||
@time_entry1 = TimeEntry.find 1
|
||||
|
||||
@ -21,7 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# User patch test class
|
||||
class UserPatchTest < RedmineCustomWorkflows::Test::UnitTest
|
||||
fixtures :users
|
||||
|
||||
def setup
|
||||
@user1 = User.find 1
|
||||
|
||||
@ -21,7 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# Version patch test class
|
||||
class VersionPatchTest < RedmineCustomWorkflows::Test::UnitTest
|
||||
fixtures :versions
|
||||
|
||||
def setup
|
||||
@version1 = Version.find 1
|
||||
|
||||
@ -21,7 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# Wiki content patch test class
|
||||
class WikiContentPatchTest < RedmineCustomWorkflows::Test::UnitTest
|
||||
fixtures :wiki_contents
|
||||
|
||||
def setup
|
||||
@wiki_content1 = WikiContent.find 1
|
||||
|
||||
@ -21,7 +21,6 @@ require File.expand_path('../../test_helper', __FILE__)
|
||||
|
||||
# Wiki page test class
|
||||
class WikiPagePatchTest < RedmineCustomWorkflows::Test::UnitTest
|
||||
fixtures :wiki_pages
|
||||
|
||||
def setup
|
||||
@wiki_page1 = WikiPage.find 1
|
||||
|
||||
@ -21,15 +21,16 @@ module RedmineCustomWorkflows
|
||||
module Test
|
||||
# Unit test base class
|
||||
class UnitTest < ActiveSupport::TestCase
|
||||
# Allow us to override the fixtures method to implement fixtures for our plugin.
|
||||
# Ultimately it allows for better integration without blowing redmine fixtures up,
|
||||
# and allowing us to suppliment redmine fixtures if we need to.
|
||||
def self.fixtures(*table_names)
|
||||
dir = File.join(File.dirname(__FILE__), '/fixtures')
|
||||
table_names.each do |x|
|
||||
ActiveRecord::FixtureSet.create_fixtures(dir, x) if File.exist?("#{dir}/#{x}.yml")
|
||||
|
||||
def initialize(name)
|
||||
super(name)
|
||||
# Load all plugin's fixtures
|
||||
dir = File.join(File.dirname(__FILE__), 'fixtures')
|
||||
ext = '.yml'
|
||||
Dir.glob("#{dir}/**/*#{ext}").each do |file|
|
||||
fixture = File.basename(file, ext)
|
||||
ActiveRecord::FixtureSet.create_fixtures dir, fixture
|
||||
end
|
||||
super(table_names)
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user