assert !pi.state, 'expected state to be nil because the fixture had no state specified'
# save the pipeline and expect state to be New
+ Thread.current[:user] = users(:admin)
+
pi.save
pi = PipelineInstance.find_by_uuid 'zzzzz-xxxxx-f4gneyn6br1xize'
assert_equal PipelineInstance::New, pi.state, 'expected state to be New for new pipeline'
end
test "update attributes for pipeline" do
+ Thread.current[:user] = users(:admin)
+
pi = pipeline_instances :new_pipeline
# add a component with no input and expect state to be New
assert_equal pi.components.size, 1, 'expected one component'
assert !pi.active, 'expected active to be false after update'
assert !pi.success, 'expected success to be false for a new pipeline'
-
+
pi.active = true
pi.save
pi = PipelineInstance.find_by_uuid 'zzzzz-xxxxx-f4gneyn6br1xize'
pi.components['first'] = component1
pi.components['second'] = component2
components = pi.components
+
+ Thread.current[:user] = users(:admin)
pi.update_attribute 'components', pi.components
+
pi = PipelineInstance.find_by_uuid 'zzzzz-xxxxx-f4gneyn6br1xize'
assert_equal PipelineInstance::New, pi.state, 'expected state to be New after adding component with input'
assert_equal pi.components.size, 2, 'expected two components'