aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Graaff <graaff@gentoo.org>2019-07-22 12:28:57 +0200
committerHans de Graaff <graaff@gentoo.org>2019-07-22 12:28:57 +0200
commit404784f1c3ccdf8a5594e74e3a2f1b89acd4d59a (patch)
treeb3358c6cfe207675c70c19782b64435505c3b2e3
parentRemove category tests for unimplemented methods (diff)
downloadpackages-5-404784f1c3ccdf8a5594e74e3a2f1b89acd4d59a.tar.gz
packages-5-404784f1c3ccdf8a5594e74e3a2f1b89acd4d59a.tar.bz2
packages-5-404784f1c3ccdf8a5594e74e3a2f1b89acd4d59a.zip
Provide a test fixture repo and use it for tests
Signed-off-by: Hans de Graaff <graaff@gentoo.org>
-rw-r--r--test/controllers/categories_controller_test.rb2
-rw-r--r--test/fixtures/.keep0
-rw-r--r--test/fixtures/repo/virtual/metadata.xml11
-rw-r--r--test/test_helper.rb7
4 files changed, 16 insertions, 4 deletions
diff --git a/test/controllers/categories_controller_test.rb b/test/controllers/categories_controller_test.rb
index 5b4ccd8..cc12462 100644
--- a/test/controllers/categories_controller_test.rb
+++ b/test/controllers/categories_controller_test.rb
@@ -8,7 +8,7 @@ class CategoriesControllerTest < ActionController::TestCase
end
test "should show category" do
- get :show, id: @category
+ get :show, id: 'virtual'
assert_response :success
end
diff --git a/test/fixtures/.keep b/test/fixtures/.keep
deleted file mode 100644
index e69de29..0000000
--- a/test/fixtures/.keep
+++ /dev/null
diff --git a/test/fixtures/repo/virtual/metadata.xml b/test/fixtures/repo/virtual/metadata.xml
new file mode 100644
index 0000000..45ed7f2
--- /dev/null
+++ b/test/fixtures/repo/virtual/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<catmetadata>
+ <longdescription lang="en">
+ The virtual category contains packages which satisfy virtual dependencies.
+ </longdescription>
+ <longdescription lang="es">
+ La categorĂ­a virtual contiene paquetes para satisfacer las
+ dependencias virtuales.
+ </longdescription>
+</catmetadata>
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 9962fe4..98b65a4 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -3,8 +3,9 @@ require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
class ActiveSupport::TestCase
- # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
- # fixtures :all
+ # Import some test data into the test indices
+ category = Portage::Repository::Category.new('test/fixtures/repo/virtual')
+ Category.new.import!(category)
# Add more helper methods to be used by all tests here...
-end \ No newline at end of file
+end