Sha256: 58e9c268716d33d6e4f998e7e69a098146f16bfa1304d3edb38025850f122551

Contents?: true

Size: 891 Bytes

Versions: 4

Compression:

Stored size: 891 Bytes

Contents

ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'

# compound_label_hash = {
#   "Weltraumkampfpilot" => %w(Weltraum Kampf Pilot)
# }
def create_compound_form_label(compound_label_hash)
  compound_label_hash.each do |term, components|
    label = Iqvoc::XLLabel.base_class.create!(
      value: term,
      language: Iqvoc::Concept.pref_labeling_languages.first,
      published_at: 2.days.ago)

    label.compound_forms.create!(compound_form_contents: components.each_with_index.map { |cterm, i|
      clabel = Iqvoc::XLLabel.base_class.create!(value: cterm,
                                                 language: Iqvoc::Concept.pref_labeling_languages.first,
                                                 published_at: 2.days.ago)
      CompoundForm::Content::Base.new(:label => clabel, :order => i)
    })
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
iqvoc_compound_forms-2.11.4 test/test_helper.rb
iqvoc_compound_forms-2.11.3 test/test_helper.rb
iqvoc_compound_forms-2.9.0 test/test_helper.rb
iqvoc_compound_forms-2.8.0 test/test_helper.rb