<commit_before>import FullXhrService from 'glazier/services/full_xhr';
import { inCard, TestService } from 'helpers/card_test_helpers';

import Condcutor from 'conductor';

var conductor, card;

if (/phantom/i.test(navigator.userAgent)) { return; }

module("Glazier FullXhrService", {
  setup: function() {
    conductor = new Conductor({
      testing: true,
      conductorURL: '/vendor/conductor.js.html'
    });

    Conductor.services['fullXhr'] = FullXhrService;
    Conductor.services['test'] = TestService;

    card = conductor.load('/test/fixtures/app/services/full_xhr_card.js', 1, {
      capabilities: ['fullXhr', 'test']
    });

    card.appendTo('#qunit-fixture');
  }
});

asyncTest("A card can return a configuration value by name", 1, function() {
  inCard(card, function(card) {
    var fullXhrService = card.consumers.fullXhr;

    return fullXhrService.request('ajax', {
      url: '/test/fixtures/app/services/foo.txt'
    }).then(function(result) {
      start();
      ok( /bar/.test(result), 'retrieves text from fixture via xhr');
      return result;
    });
  });
});
<commit_msg>Fix test name<commit_after>import FullXhrService from 'glazier/services/full_xhr';
import { inCard, TestService } from 'helpers/card_test_helpers';

import Condcutor from 'conductor';

var conductor, card;

if (/phantom/i.test(navigator.userAgent)) { return; }

module("Glazier FullXhrService", {
  setup: function() {
    conductor = new Conductor({
      testing: true,
      conductorURL: '/vendor/conductor.js.html'
    });

    Conductor.services['fullXhr'] = FullXhrService;
    Conductor.services['test'] = TestService;

    card = conductor.load('/test/fixtures/app/services/full_xhr_card.js', 1, {
      capabilities: ['fullXhr', 'test']
    });

    card.appendTo('#qunit-fixture');
  }
});

asyncTest("A card can retrieve data via XHR", 1, function() {
  inCard(card, function(card) {
    var fullXhrService = card.consumers.fullXhr;

    return fullXhrService.request('ajax', {
      url: '/test/fixtures/app/services/foo.txt'
    }).then(function(result) {
      start();
      ok( /bar/.test(result), 'retrieves text from fixture via xhr');
      return result;
    });
  });
});

{'fraction_non_alphanumeric': 0.153427144802542, 'fraction_numerical': 0.0018157058556513845, 'mean_word_length': 3.699360341151386, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6627302', 'n_tokens_mistral': 750, 'n_tokens_neox': 717, 'n_words': 146}