oveits / ProvisioningEngine

Ruby on Rails based ProvisioningEngine Frontend for provisioning of legacy systems via Apache Camel Backend (SOAP/XML+SPML+File import)
3 stars 6 forks source link

rspec error: "Validation failed: Name is already taken for this customer..." #37

Closed oveits closed 8 years ago

oveits commented 8 years ago

This bug has been introduced in https://github.com/oveits/ProvisioningEngine/commit/bd4102ebaaed29fb3771e3c670e69d46f347abbb:

If the rspec tests are done in a certain order 1) sync(User) via model on target 'Environment1_V8' 2) sync(User) via model on target 'Environment2_V7R1' 3) synchronize all Users on target 'Environment2_V7R1'

then the last test has failed with a "Validation failed: Name is already taken for this customer..." message.

Full trace:

$ ./startTests -e "sync(User) via model in async=false mode" -e "On target solution 'Environment2_V7R1' synchronize all Users for testTarget == model should synchronize the index with the User objects found on the target system"
...
On target solution 'Environment1_V8'
  sync(User) via model
    in async=false mode
      should update the status of the object to 'provisioned' if it is provisioned on the target system already

On target solution 'Environment2_V7R1'
  synchronize all Users for testTarget == model
    should synchronize the index with the User objects found on the target system
  sync(User) via model
    in async=false mode
      should update the status of the object to 'provisioned' if it is provisioned on the target system already
...
1) On target solution 'Environment2_V7R1' synchronize all Users for testTarget == model should synchronize the index with the User objects found on the target system
     Failure/Error: myObj.save!
     ActiveRecord::RecordInvalid:
       Validation failed: Name is already taken for this customer, Mainextension [10000] is already taken for target "Environment2_V7R1"!, Gatewayip [47.68.190.57] is already taken for target "Environment2_V7R1"!
     # ./spec/requests/provisioningobjects_spec.rb:399:in `createObjDB'
     # ./spec/requests/provisioningobjects_spec.rb:393:in `createObjDB'
     # ./spec/requests/provisioningobjects_spec.rb:348:in `initObj'
     # ./spec/requests/provisioningobjects_spec.rb:1175:in `block (6 levels) in <top (required)>'