<commit_before>var angular = require('angular');

describe('auth controller basic', () => {
  var $httpBackend;
  var $scope;
  var $ControllerConstructor;

  beforeEach(angular.mock.module('omnifilterApp'));

  beforeEach(angular.mock.inject(function($rootScope, $controller) {
    $ControllerConstructor = $controller;
    $scope = $rootScope.$new();
  }));

  it('should be able to make a controller', () => {
    var authController = $ControllerConstructor('authController', { $scope });
    expect(typeof authController).toBe('object');
    expect(typeof $scope.updateEmail).toBe('function');
  });

  describe('function calls', () => {
    beforeEach(angular.mock.inject(function(_$httpBackend_) {
      $httpBackend = _$httpBackend_;
      $ControllerConstructor('authController', { $scope });
    }));

    afterEach(() => {
      $httpBackend.verifyNoOutstandingExpectation();
      $httpBackend.verifyNoOutstandingRequest();
    });

    it('should call to verify path', () => {
      $scope.email = null;
      $httpBackend.expectGET('http://localhost:3000/verify')
      .respond(200, { email: 'tester' });
      $scope.updateEmail();
      $httpBackend.flush();
      expect($scope.email).toBe('tester');
    });

    it('should call to log out path', () => {
      $scope.email = '<EMAIL>';
      $scope.logout();
      expect($scope.email).toBe(null);
    });
  });
});<commit_msg>Added test to auth controller suite to check for the location after calling logout.<commit_after>var angular = require('angular');

describe('auth controller basic', () => {
  var $httpBackend;
  var $scope;
  var $ControllerConstructor;
  var $location;

  beforeEach(angular.mock.module('omnifilterApp'));

  beforeEach(angular.mock.inject(function($rootScope, $controller, _$location_) {
    $ControllerConstructor = $controller;
    $scope = $rootScope.$new();
    $location = _$location_;
  }));

  it('should be able to make a controller', () => {
    var authController = $ControllerConstructor('authController', { $scope });
    expect(typeof authController).toBe('object');
    expect(typeof $scope.updateEmail).toBe('function');
  });

  describe('function calls', () => {
    beforeEach(angular.mock.inject(function(_$httpBackend_) {
      $httpBackend = _$httpBackend_;
      $ControllerConstructor('authController', { $scope });
    }));

    afterEach(() => {
      $httpBackend.verifyNoOutstandingExpectation();
      $httpBackend.verifyNoOutstandingRequest();
    });

    it('should call to verify path', () => {
      $scope.email = null;
      $httpBackend.expectGET('http://localhost:3000/verify')
      .respond(200, { email: 'tester' });
      $scope.updateEmail();
      $httpBackend.flush();
      expect($scope.email).toBe('tester');
    });

    it('should call to log out path', () => {
      $scope.email = '<EMAIL>';
      $scope.logout();
      expect($scope.email).toBe(null);
      expect($location.path()).toBe('/signin');
    });


  });
});
{'fraction_non_alphanumeric': 0.17569841804106362, 'fraction_numerical': 0.004712218108381017, 'mean_word_length': 3.785829307568438, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '499478', 'n_tokens_mistral': 871, 'n_tokens_neox': 862, 'n_words': 155}