features/step_definitions/remi_step.rb in remi-0.3.0 vs features/step_definitions/remi_step.rb in remi-0.3.1

- old
+ new

@@ -59,10 +59,11 @@ expect(@brt.source.data_subject.extractors.map(&:most_recent_only)).not_to include eq true end Then /^the file that comes last in an alphanumeric sort by group will be downloaded for processing$/ do expect(@brt.source.data_subject.extractors.map(&:most_recent_by)).to include :name + expect(@brt.source.data_subject.extractors.map(&:most_recent_only)).not_to include false end Then /^the file is uploaded to the remote path "([^"]+)"$/ do |remote_path| expected_path = Remi::Testing::BusinessRules::ParseFormula.parse(remote_path) expect(@brt.target.data_subject.loaders.map(&:remote_path)).to include expected_path @@ -623,9 +624,24 @@ end @brt.run_transforms expect(@brt.target.data_subject.df.vectors.to_a).to match_array @brt.target.fields.field_names end + +Then /^only the following fields should be present on the targets:$/ do |table| + table.rows.each do |row| + field = row[0] + targets = row[1].split(',') + targets.each { |target| step "the target field '#{target}: #{field}'" } + end + + @brt.run_transforms + @brt.targets.keys.each do |target| + expect(@brt.targets[target].data_subject.df.vectors.to_a).to match_array @brt.targets[target].fields.field_names + end +end + + ### Record-level expectations Then /^the record from source '(.+)' should be (?i)(Retained|Rejected)(?-i)(?: without error|)$/ do |source_name, action| source_size = @brt.sources[source_name].size