#592 added tests
Merge pull request #616 from joola/feature/#592

#592 added tests