Created rspec tests for global controller and fixed two defects