Restructuring the functional headless testing for the jasmine Gem