<commit_before>require 'test_helper'
require 'gds_api/need_api'

describe GdsApi::NeedApi do

  before do
    @base_api_url = Plek.current.find("needapi")
    @api = GdsApi::NeedApi.new(@base_api_url)
  end

  describe "creating needs" do
    it "should post to the right endpoint" do
      stub_request(:post, @base_api_url + "/needs").with(
        :body => '{"goal":"I wanna sammich!"}'
      )
      @api.create_need({"goal" => "I wanna sammich!"})
    end
  end
end<commit_msg>Assert the stub need request is actually called.<commit_after>require 'test_helper'
require 'gds_api/need_api'

describe GdsApi::NeedApi do

  before do
    @base_api_url = Plek.current.find("needapi")
    @api = GdsApi::NeedApi.new(@base_api_url)
  end

  describe "creating needs" do
    it "should post to the right endpoint" do
      request_stub = stub_request(:post, @base_api_url + "/needs").with(
        :body => '{"goal":"I wanna sammich!"}'
      )
      @api.create_need({"goal" => "I wanna sammich!"})
      assert_requested(request_stub)
    end
  end
end
{'fraction_non_alphanumeric': 0.13320647002854424, 'fraction_numerical': 0.0, 'mean_word_length': 3.6140350877192984, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 7, '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': '6921496', 'n_tokens_mistral': 377, 'n_tokens_neox': 369, 'n_words': 92}