<commit_before>require "minitest/autorun"
require_relative "./test_helper"

describe "api" do
  describe "/api/test" do
    it "returns 'hello world'" do
      request("/api/test").must_equal("Hello world")
    end
  end

  describe "/api/clients" do
    skip_if_impl_in %w(elixir_phoenix node_express ruby_sinatra)

    seed(<<-SQL)
      INSERT INTO clients SET
        name="<NAME>",
        address="625 NW Everett St",
        city="Portland",
        state="OR",
        zip="97209",
        country="USA",
        email="<EMAIL>",
        contact="<NAME>",
        phone="(503) 662-2712",
        created_at="2006-06-25T14:08:31",
        updated_at="2015-08-29T09:58:23";
    SQL

    it "returns a json list of clients" do
      request("/api/clients").must_equal({
        "data" => [{
          "type" => "clients",
          "id" => "1",
          "attributes" => {
            "name" => "<NAME>",
            "address" => "625 NW Everett St",
            "city" => "Portland",
            "state" => "OR",
            "zip" => "97209",
            "country" => "USA",
            "email" => "<EMAIL>",
            "contact" => "<NAME>",
            "phone" => "(503) 662-2712",<commit_msg>actually test the thing with elixir<commit_after>require "minitest/autorun"
require_relative "./test_helper"

describe "api" do
  describe "/api/test" do
    it "returns 'hello world'" do
      request("/api/test").must_equal("Hello world")
    end
  end

  describe "/api/clients" do
    skip_if_impl_in %w(node_express ruby_sinatra)

    seed(<<-SQL)
      INSERT INTO clients SET
        name="Bot and Rose Design",
        address="625 NW Everett St",
        city="Portland",
        state="OR",
        zip="97209",
        country="USA",
        email="<EMAIL>",
        contact="<NAME>",
        phone="(503) 662-2712",
        created_at="2006-06-25T14:08:31",
        updated_at="2015-08-29T09:58:23";
    SQL

    it "returns a json list of clients" do
      request("/api/clients").must_equal({
        "data" => [{
          "type" => "clients",
          "id" => "1",
          "attributes" => {
            "name" => "<NAME>",
            "address" => "625 NW Everett St",
            "city" => "Portland",
            "state" => "OR",
            "zip" => "97209",
            "country" => "USA",
            "email" => "<EMAIL>",
            "contact" => "<NAME>",
            "phone" => "(503) 662-2712",
{'fraction_non_alphanumeric': 0.1740924092409241, 'fraction_numerical': 0.05363036303630363, 'mean_word_length': 1.9718137254901962, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 40, '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': '1399679', 'n_tokens_mistral': 871, 'n_tokens_neox': 776, 'n_words': 174}