<commit_before>module Yesmail2
  describe Email do
    describe '.send' do
      let(:template_id) { 'foo' }
      let(:subscriber) do
        { id: '<EMAIL>', email: '<EMAIL>' }
      end

      it 'invokes the correct shit' do
        body = { content: [template_id], recipients: [subscriber] }
        WebMock
          .stub_request(:post, 'https://api.yesmail.com/v2/emails/send')
          .with(body: body.to_json)
          .to_return(status: 200, body: '{}')

        Email.send([template_id], [subscriber])
      end
    end
  end
end<commit_msg>Update spec to reflect accurate API usage<commit_after>module Yesmail2
  describe Email do
    describe '.send' do
      let(:template_id) { 'foo' }
      let(:subscriber) do
        { id: '<EMAIL>', email: '<EMAIL>' }
      end

      it 'invokes the correct shit' do
        body = {
          content: { templateId: template_id },
          recipients: [subscriber]
        }
        WebMock
          .stub_request(:post, 'https://api.yesmail.com/v2/emails/send')
          .with(body: body.to_json)
          .to_return(status: 200, body: '{}')

        Email.send({ templateId: template_id }, [subscriber])
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.13377926421404682, 'fraction_numerical': 0.008361204013377926, 'mean_word_length': 2.1750663129973473, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '4863750', 'n_tokens_mistral': 389, 'n_tokens_neox': 381, 'n_words': 92}