[QAE1030] Rspec coverage

* Small refactoring
* Some fixes
* Rspec tests
I guess we should not specify URN since it's created automatically.