プロジェクト

全般

プロフィール

« | » 

リビジョン 629e7d4b

高徹 高橋 徹 さんが7年以上前に追加

Add plugin's fixtures directory to read fixtures on test

差分を表示:

test/test_helper.rb
# -*- coding: utf-8 -*-
# Load the normal Rails helper
require File.expand_path(File.dirname(__FILE__) + '/../../../test/test_helper')
# Ensure that we are using the temporary fixture path
Engines::Testing.set_fixture_path
module Redmine
module PluginFixturesLoader
def self.included(base)
base.class_eval do
def self.plugin_fixtures(*symbols)
ActiveRecord::FixtureSet.create_fixtures(File.dirname(__FILE__) + '/fixtures/', symbols)
end
end
end
end
end
## ファンクショナルテスト
unless ActionController::TestCase.included_modules.include?(Redmine::PluginFixturesLoader)
ActionController::TestCase.send :include, Redmine::PluginFixturesLoader
end
## ユニットテスト
unless ActiveSupport::TestCase.included_modules.include?(Redmine::PluginFixturesLoader)
ActiveSupport::TestCase.send :include, Redmine::PluginFixturesLoader
end
## インテグレーションテスト
unless Redmine::IntegrationTest.included_modules.include?(Redmine::PluginFixturesLoader)
Redmine::IntegrationTest.send :include, Redmine::PluginFixturesLoader
end
test/unit/glossary_style_test.rb
require File.dirname(__FILE__) + '/../test_helper'
class GlossaryStyleTest < ActiveSupport::TestCase
fixtures :glossary_styles
plugin_fixtures :glossary_styles
# Replace this with your real tests.
def test_truth
test/unit/term_category_test.rb
require File.dirname(__FILE__) + '/../test_helper'
class TermCategoryTest < ActiveSupport::TestCase
fixtures :term_categories
plugin_fixtures :term_categories
# Replace this with your real tests.
def test_truth
test/unit/term_query_test.rb
require File.dirname(__FILE__) + '/../test_helper'
class TermQueryTest < ActiveSupport::TestCase
fixtures :term_queries
plugin_fixtures :term_queries
# Replace this with your real tests.
def test_truth
test/unit/term_test.rb
require File.dirname(__FILE__) + '/../test_helper'
class TermTest < ActiveSupport::TestCase
fixtures :terms
plugin_fixtures :terms
# Replace this with your real tests.
def test_truth

他の形式にエクスポート: Unified diff