Sha256: 78206ab70a05e2031c99c438d8b5daa8f39540a67baab3243dde30668573bd91

Contents?: true

Size: 1.56 KB

Versions: 36

Compression:

Stored size: 1.56 KB

Contents

require File.dirname(__FILE__) + '/spec_helper.rb'

describe Twitter::User do  
  it "should create new user from xml doc" do
    xml = <<EOF
<user>
  <id>18713</id>
  <name>Alex Payne</name>
  <screen_name>al3x</screen_name>
  <location>San Francisco, CA</location>
  <description>Oh, hi.  No, I just work here.</description>
  <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/51961745/al3x_normal.jpg</profile_image_url>
  <url>http://www.al3x.net</url>
  <protected>false</protected>
  <followers_count>2889</followers_count>
  <status>
    <created_at>Sun May 04 22:38:39 +0000 2008</created_at>
    <id>803453211</id>
    <text>@5dots Yes.  Give me about 8 hours.  *sigh*</text>

    <source>&lt;a href="http://iconfactory.com/software/twitterrific"&gt;twitterrific&lt;/a&gt;</source>
    <truncated>false</truncated>
    <in_reply_to_status_id>803450314</in_reply_to_status_id>
    <in_reply_to_user_id>618923</in_reply_to_user_id>
    <favorited>false</favorited>

  </status>
</user>
EOF
    u = Twitter::User.new_from_xml(Hpricot.XML(xml))
    u.id.should == '18713'
    u.name.should =='Alex Payne'
    u.screen_name.should == 'al3x'
    u.location.should == 'San Francisco, CA'
    u.description.should == 'Oh, hi.  No, I just work here.'
    u.profile_image_url.should == 'http://s3.amazonaws.com/twitter_production/profile_images/51961745/al3x_normal.jpg'
    u.url.should == 'http://www.al3x.net'
    u.protected.should == false
    u.followers_count.should == '2889'
    u.status.text.should == '@5dots Yes.  Give me about 8 hours.  *sigh*'
  end
end

Version data entries

36 entries across 36 versions & 13 rubygems

Version Path
anthonycrumley-twitter-0.3.8 spec/user_spec.rb
baron-twitter-0.4.2 spec/user_spec.rb
billymeltdown-twitter-0.3.8.1 spec/user_spec.rb
billymeltdown-twitter-0.4.2 spec/user_spec.rb
billymeltdown-twitter-0.4.3 spec/user_spec.rb
drnic-twitter-0.4.4.1 spec/user_spec.rb
dschn-twitter-0.3.7.1 spec/user_spec.rb
dschn-twitter-0.3.7.2 spec/user_spec.rb
dschn-twitter-0.4.1.1 spec/user_spec.rb
dschn-twitter-0.4.1.2 spec/user_spec.rb
dschn-twitter-0.4.1.3 spec/user_spec.rb
dschn-twitter-0.4.1 spec/user_spec.rb
dustin-twitter-0.3.2.1 spec/user_spec.rb
dustin-twitter-0.3.2.2 spec/user_spec.rb
dustin-twitter-0.3.7 spec/user_spec.rb
gilesbowkett-gilesbowkett-twitter-0.4.4 spec/user_spec.rb
gilesbowkett-twitter-0.4.3 spec/user_spec.rb
gilesbowkett-twitter-0.4.5 spec/user_spec.rb
handcrafted-twitter-0.4.0 spec/user_spec.rb
handcrafted-twitter-0.4.2 spec/user_spec.rb