spec/rubytter_spec.rb in rubytter-0.6.0 vs spec/rubytter_spec.rb in rubytter-0.6.1
- old
+ new
@@ -201,10 +201,11 @@
it 'should convert search results to struct' do
json_data = {
'id' => '123',
'text' => 'foo foo bar bar',
+ 'created_at' => 'Sat, 21 Mar 2009 09:48:20 +0000',
'source' => '<a href="http:\/\/twitter.com\/">web<\/a>',
'to_usre_id' => '20660692',
'to_usre' => 'jugyo_test',
'from_user_id' => '3748631',
'from_user' => 'jugyo',
@@ -212,10 +213,11 @@
}
rubytter = Rubytter.new('test', 'teat')
result = rubytter.search_result_to_struct(json_data)
result['id'].should == '123'
result['text'].should == 'foo foo bar bar'
+ result['created_at'].should == 'Sat, 21 Mar 2009 09:48:20 +0000'
result['source'].should == "<a href=\"http:\\/\\/twitter.com\\/\">web<\\/a>"
result['in_reply_to_user_id'].should == '20660692'
result['in_reply_to_screen_name'].should == 'jugyo_test'
result['user']['id'].should == '3748631'
result['user']['screen_name'].should == 'jugyo'
@@ -228,11 +230,12 @@
@rubytter.stub!(:http_request).and_return(json_data)
statuses = @rubytter.search('termtter')
status = statuses[0]
status.id.should == 1365281728
- status.source.should == "<a href=\"http://twitter.com/\">web</a>"
status.text.should == "よし、add_hook 呼んでるところが無くなった #termtter"
+ status.created_at.should == "Sat, 21 Mar 2009 09:48:20 +0000"
+ status.source.should == "<a href=\"http://twitter.com/\">web</a>"
status.in_reply_to_user_id.should == nil
status.in_reply_to_screen_name.should == nil
status.in_reply_to_status_id.should == nil
status.user.id.should == 74941
status.user.screen_name.should == "jugyo"