features/step_definitions/remi_step.rb in remi-0.2.30 vs features/step_definitions/remi_step.rb in remi-0.2.31
- old
+ new
@@ -63,10 +63,13 @@
@brt.filestore.generate
@brt.source.mock_extractor(@brt.filestore)
expect(@brt.source.extract).to match_array Array(@brt.filestore.latest)
end
+Then /^files will be downloaded for processing$/ do
+end
+
Then /^no files will be downloaded for processing$/ do
@brt.filestore.generate
@brt.source.mock_extractor(@brt.filestore)
expect { @brt.source.extract }.to raise_error Remi::Extractor::SftpFile::FileNotFoundError
end
@@ -413,17 +416,20 @@
step "the source field '#{source_field}'"
source_name, source_field_name = @brt.sources.parse_full_field(source_field)
target_names, target_field_name = @brt.targets.parse_full_field(target_field, multi: true)
- prefixed_source = "#{prefix}#{@brt.sources[source_name].fields[source_field_name].value}"
+ prefixed_source = @brt.sources[source_name].fields[source_field_name].values.map do |value|
+ "#{prefix}#{value}"
+ end.uniq.sort
@brt.run_transforms
- Array(target_names).each do |target_name|
- expect(@brt.targets[target_name].fields[target_field_name].value).to eq prefixed_source
- end
+ results = Array(target_names).map do |target_name|
+ @brt.targets[target_name].fields[target_field_name].values.uniq
+ end.flatten.uniq.sort
+ expect(results).to eq prefixed_source
end
Then /^the source field is prefixed with "([^"]*)" and loaded into the target field '([^']+)'$/ do |prefix, target_field|
@brt.sources.fields.each do |source_field|
step "the source field '#{source_field.full_name}' is prefixed with \"#{prefix}\" and loaded into the target field '#{target_field}'"
@@ -630,9 +636,18 @@
Then /^a target record is not created$/ do
@brt.run_transforms
expect(@brt.targets.total_size).to be 0
end
+
+### Setting up data for multiple records
+
+Given /^the source field '([^']+)' is a unique integer$/ do |source_field|
+ step "the source field '#{source_field}'"
+ source_name, source_field_name = @brt.sources.parse_full_field(source_field)
+
+ @brt.sources[source_name].unique_integer_field(source_field_name)
+end
### Record counting
Then /^the target has (\d+) record(?:s|)$/ do |nrecords|
target_name = @brt.targets.keys.first