<commit_before>rest_api_factory_tests = ->
  describe "createSurveyDraftApi", ->
    it "should invoke $resource with an empty object when no id is provided", ->
      resourceSpy = sinon.spy()
      factory = restApiFactory(resourceSpy)
      factory.createSurveyDraftApi()
      expect(resourceSpy).toHaveBeenCalledWith "/api/survey_drafts"

    it "should invoke $resource with a custom save object when an id is provided", ->
      resourceSpy = sinon.spy()
      factory = restApiFactory(resourceSpy)
      factory.createSurveyDraftApi 1
      expect(resourceSpy).toHaveBeenCalledWith "/api/survey_drafts/:id",
        id: 1
      ,
        save:
          method: "PATCH"
<commit_msg>fixed broken test<commit_after>rest_api_factory_tests = ->
  describe "createSurveyDraftApi", ->
    it "should invoke $resource with an empty object when no id is provided", ->
      resourceSpy = sinon.spy()
      factory = restApiFactory(resourceSpy)
      factory.createSurveyDraftApi()
      expect(resourceSpy).toHaveBeenCalledWith "/api/survey_drafts"

    iit "should invoke $resource with a custom save object when an id is provided", ->
      resourceSpy = sinon.spy()
      factory = restApiFactory(resourceSpy)
      factory.createSurveyDraftApi 1
      expect(resourceSpy).toHaveBeenCalledWith "/api/survey_drafts/:id",
        id: 1
      ,
        save:
          method: "PATCH"
        publish:
          method: "POST"
          url: "/api/survey_drafts/:id/publish"

{'fraction_non_alphanumeric': 0.09491525423728814, 'fraction_numerical': 0.002711864406779661, 'mean_word_length': 2.967741935483871, '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': '410720', 'n_tokens_mistral': 448, 'n_tokens_neox': 448, 'n_words': 107}