refactored test
added more unit tests
added test with httpbackend