test/test_comment.rb in whatser-0.4.0 vs test/test_comment.rb in whatser-0.5.0
- old
+ new
@@ -3,10 +3,23 @@
class TestComment < Test::Unit::TestCase
def setup
@client = Whatser::Client.new
@poi_id = 1
@media_id = 1
- @comment = Whatser::Comment.new(:poi_id => @poi_id, :body => 'test')
+ @user_id = 1
+ @comment = Whatser::Comment.new(:poi_id => @poi_id, :body => 'test', :user_id => @user_id)
+ end
+
+ def test_poi
+ assert @comment.poi.is_a?(Whatser::Response)
+ @comment.poi_id = nil
+ assert_nil @comment.poi
+ end
+
+ def test_user
+ assert @comment.user.is_a?(Whatser::Response)
+ @comment.user_id = nil
+ assert_nil @comment.user
end
def test_poi_list
assert @client.comments.poi(@poi_id, :page => 1).is_a?(Whatser::Response)
end
\ No newline at end of file