Refactor and fix spec/controllers/exam_groups_controller_spec.rb