Skip to content

Instantly share code, notes, and snippets.

@dstarh
Created April 17, 2015 20:42
Show Gist options
  • Save dstarh/d2a196841a04ac9697c3 to your computer and use it in GitHub Desktop.
Save dstarh/d2a196841a04ac9697c3 to your computer and use it in GitHub Desktop.
sentence_breakdown = TestData.one_food_with_unit_and_slot
nlp_wrapper_mock = mock('nlp_wrapper')
raw_text = "I ate some beef stew"
NlpWrapper.stubs(:new).returns(stanford_nlp_wrapper_mock)
nlp_wrapper_mock.expects(:parse).with(raw_text).returns(sentence_breakdown)
assert_difference "NlpSentencesBreakdownAuditLog.count", 1 do
post :create, format: :json, api_version: 1,
raw_text: "I ate some beef stew"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment