Sha256: 0004dceb9a5282000781e79024edf949bd2a6598f0609af61d5a445bf45cd43a

Contents?: true

Size: 1.78 KB

Versions: 10

Compression:

Stored size: 1.78 KB

Contents

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

describe Tweetsy::Status do
  it "should create new status from xml doc" do
    xml = <<EOF
<status>
	<created_at>Sun May 04 21:59:52 +0000 2008</created_at>
	<id>803435310</id>
	<text>Writing tests (rspec) for the twitter gem that all can run. Wish I would have done this when I wrote it years back.</text>
	<source>&lt;a href="http://iconfactory.com/software/twitterrific"&gt;twitterrific&lt;/a&gt;</source>
	<truncated>false</truncated>
	<in_reply_to_status_id></in_reply_to_status_id>
	<in_reply_to_user_id></in_reply_to_user_id>
	<in_reply_to_screen_name>blah</in_reply_to_screen_name>
	<favorited>false</favorited>
	<user>
		<id>4243</id>
		<name>John Nunemaker</name>
		<screen_name>jnunemaker</screen_name>
		<location>Indiana</location>
		<description>Loves his wife, ruby, notre dame football and iu basketball</description>	
			<profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/52619256/ruby_enterprise_shirt_normal.jpg</profile_image_url>
		<url>http://addictedtonew.com</url>
		<protected>false</protected>
		<followers_count>363</followers_count>
	</user>
</status>
EOF
    s = Tweetsy::Status.new(Hpricot.XML(xml))
    s.id.should == '803435310'
    s.created_at.should == 'Sun May 04 21:59:52 +0000 2008'
    s.text.should == 'Writing tests (rspec) for the twitter gem that all can run. Wish I would have done this when I wrote it years back.'
    s.source.should == '&lt;a href="http://iconfactory.com/software/twitterrific"&gt;twitterrific&lt;/a&gt;'
    s.truncated.should == "false"
    s.in_reply_to_status_id.should == ''
    s.in_reply_to_user_id.should == ''
    s.in_reply_to_screen_name.should == 'blah'
    s.favorited.should == "false"
    s.user.id.should == '4243'
    s.user.name.should == 'John Nunemaker'
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
dschn-tweetsy-0.1.0 spec/status_spec.rb
dschn-tweetsy-0.1.1 spec/status_spec.rb
dschn-tweetsy-0.1.2 spec/status_spec.rb
dschn-tweetsy-0.1.3 spec/status_spec.rb
dschn-tweetsy-0.1.4 spec/status_spec.rb
dschn-tweetsy-0.1.5 spec/status_spec.rb
dschn-tweetsy-0.1.6 spec/status_spec.rb
dschn-tweetsy-0.1.7 spec/status_spec.rb
dschn-tweetsy-0.1.8 spec/status_spec.rb
dschn-tweetsy-0.1.9 spec/status_spec.rb