Skip to content

Commit 87fabd7

Browse files
committed
fix test using eager_load = true (via CI env var)
1 parent bad67a3 commit 87fabd7

File tree

4 files changed

+28
-18
lines changed

4 files changed

+28
-18
lines changed

config/initializers/iqvoc_skosxl.rb

+9
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
11
require 'iqvoc/xllabel'
2+
3+
if Rails.env.test?
4+
# FIXME: needed in tests for config.eager_load = true at rails boot
5+
# move somewhere to test/
6+
Iqvoc::Xllabel.relation_class_names = [
7+
'Label::Relation::Skosxl::Translation',
8+
'Label::Relation::Skosxl::UnidirectionalRelation'
9+
]
10+
end

test/integration/label_relation_test.rb

-18
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,6 @@
1818

1919
class LabelsRelationTest < ActionDispatch::IntegrationTest
2020

21-
# sample bidirectional relation
22-
module Label::Relation::Skosxl
23-
class Translation < Label::Relation::Skosxl::Base
24-
def self.bidirectional?
25-
true
26-
end
27-
end
28-
29-
class UnidirectionalRelation < Label::Relation::Skosxl::Base
30-
end
31-
end
32-
33-
# add label relation to iqvoc initializer
34-
Iqvoc::Xllabel.relation_class_names = [
35-
'Label::Relation::Skosxl::Translation',
36-
'Label::Relation::Skosxl::UnidirectionalRelation'
37-
]
38-
3921
setup do
4022
@dog_en = Iqvoc::Xllabel.base_class.create!(
4123
language: 'en',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module Label
2+
module Relation
3+
module Skosxl
4+
class Translation < Label::Relation::Skosxl::Base
5+
def self.bidirectional?
6+
true
7+
end
8+
end
9+
end
10+
end
11+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module Label
2+
module Relation
3+
module Skosxl
4+
class UnidirectionalRelation < Label::Relation::Skosxl::Base
5+
end
6+
end
7+
end
8+
end

0 commit comments

Comments
 (0)