require 'spec_helper' describe StackExchange::StackOverflow::Question do it 'should return a question identified by its id (without body)' do question = StackOverflow::Question.find 1234 question.id.should == 1234 question.answer_count.should == 6 question.tags.should == ['csla'] question.creation_date.should == 1217857235 question.last_activity_date.should == 1236665990 question.up_vote_count.should == 2 question.down_vote_count.should be_zero question.view_count.should == 1081 question.score.should == 2 question.community_owned.should be_false question.accepted_answer_id.should == 1239 question.favorite_count.should == 1 question.question_timeline_url.should == "/questions/1234/timeline" question.question_comments_url.should == "/questions/1234/comments" question.question_answers_url.should == "/questions/1234/answers" question.owner.id.should == 296 question.owner.user_type.should == "registered" question.owner.display_name.should == "jdecuyper" question.owner.reputation.should == 1189 question.owner.email_hash.should == "21ae3e5f2968bc957b7a6fa709bea2a0" question.answers.should be_instance_of Array question.answers.size.should == 6 question.title.should == "CSLA Master Class" question.body.should be_nil end it 'should include body when using :query => { :body => true }' do question = StackOverflow::Question.find 1234, :query => { :body => true } question.body.should == "

Hi guys!\r\nAs anyone ever assisted the CSLA Master Class from Rockford Lhotka? (www).\r\n

\r\nIt seems a good way to enforce my OO knowledge in the asp.net field, but since I have to consider the flight to Atlanta and the course's price ($ 2.500), I'm not convinced yet.
\r\n
\r\nAlso, I could barrely find any feedback on the web.

\r\nCould anyone share some experience or comments?

\r\nThanks a lot.

" end it 'should find a question identified by its user_id' do response = StackOverflow::Question.find_by_user_id 333 response.page.should == 1 response.pagesize.should == 30 question = response.questions.first question.tags.should == ['c++', 'gcc'] question.answer_count.should == 3 question.accepted_answer_id.should == 267415 question.favorite_count.should == 1 question.question_timeline_url.should == "/questions/267248/timeline" question.question_comments_url.should == "/questions/267248/comments" question.question_answers_url.should == "/questions/267248/answers" question.id.should == 267248 question.creation_date.should == 1225930514 question.last_activity_date.should == 1225938787 question.up_vote_count.should == 2 question.down_vote_count.should be_zero question.view_count.should == 266 question.score.should == 2 question.community_owned.should be_false question.title.should == "Getting rid of gcc shift by negative warning" question.owner.id.should == 333 end end