features/step_definitions/calais_steps.rb in jakal-0.1.0 vs features/step_definitions/calais_steps.rb in jakal-0.1.1
- old
+ new
@@ -11,11 +11,12 @@
Given /^I have a mock calais response$/ do
@response = File.open('features/mocks/calais.json','r') {|f| f.readlines.to_s}
end
When /^I post to calais$/ do
- @response = Jkl::get_from_calais @text
+ key = YAML::load_file('config/keys.yml')['calais']
+ @response = Jkl::Extraction::get_from_calais(key, @text)
end
When /^I remove the unwanted items$/ do
@processed_json = Jkl::clean_unwanted_items_from_hash(JSON.parse(@response))
end
@@ -42,10 +43,10 @@
tags.length.should > 0
end
When /^I request the nested entities from calais$/ do
key = YAML::load_file('config/keys.yml')['calais']
- @response = Jkl::tags key, @text
+ @response = Jkl::Extraction::tags key, @text
end
Then /^I should receive the entities grouped into categories$/ do
@response.eql?({"Person"=>["Barack Obama", "Hillary Clinton"], "Position"=>["Secretary of State"]}).should == true
end