<commit_before>/*
 Organization service tests.
 The Organization service uses http to retrieve data from the server.  We'll mock the http service,
 since we don't want to go to the server in unit tests, and we're not here to test the http service itself.

 We expect that the service will return a list of organizations as an array of organization objects.
 */

import { TestBed, inject } from '@angular/core/testing';
import {
  BaseRequestOptions,
  HttpModule,
  JsonpModule,
  Http,
  Response,
  ResponseOptions
} from '@angular/http';
import { MockBackend } from '@angular/http/testing';
import { OrganizationService } from './organization.service';

describe('OrganizationService', () => {

  beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [HttpModule, JsonpModule],
      providers: [
        OrganizationService,
        {
          provide: Http,
          useFactory: (mockBackend, options) => {
            return new Http(mockBackend, options);
          },
          deps: [MockBackend, BaseRequestOptions]
        },
        MockBackend,
        BaseRequestOptions
      ]
    });
  });

  it('getOrganizations should return an observable',
    inject([OrganizationService, MockBackend], (organizationService, mockBackend) => {

      // our API returns data as an array of organizations, so mock that structure<commit_msg>secure rest api p6<commit_after>/*
 Organization service tests.
 The Organization service uses http to retrieve data from the server.  We'll mock the http service,
 since we don't want to go to the server in unit tests, and we're not here to test the http service itself.

 We expect that the service will return a list of organizations as an array of organization objects.
 */

import { TestBed, inject } from '@angular/core/testing';
import {
  BaseRequestOptions,
  HttpModule,
  JsonpModule,
  Http,
  Response,
  ResponseOptions
} from '@angular/http';
import { MockBackend } from '@angular/http/testing';
import { OrganizationService } from './organization.service';
import { AuthHttp } from 'angular2-jwt';

describe('OrganizationService', () => {

  beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [HttpModule, JsonpModule],
      providers: [
        AuthHttp,
        OrganizationService,
        {
          provide: Http,
          useFactory: (mockBackend, options) => {
            return new Http(mockBackend, options);
          },
          deps: [MockBackend, BaseRequestOptions]
        },
        MockBackend,
        BaseRequestOptions
      ]
    });
  });

  it('getOrganizations should return an observable',
    inject([OrganizationService, MockBackend], (organizationService, mockBackend) => {

      // our API returns data as an array of organizations, so mock that structure
{'fraction_non_alphanumeric': 0.0936154949784792, 'fraction_numerical': 0.0007173601147776184, 'mean_word_length': 3.162686567164179, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '3432213', 'n_tokens_mistral': 720, 'n_tokens_neox': 713, 'n_words': 257}