Sha256: 44e735c7f201251155d10cb769950eae4a7e947b0244be3fcf6b620ba32ae602

Contents?: true

Size: 1009 Bytes

Versions: 3

Compression:

Stored size: 1009 Bytes

Contents

require 'helper'

class TestComment < Test::Unit::TestCase
  def setup
    @client = Whatser::Client.new
    @poi_id = 1
    @media_id = 1    
    @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
  
  def test_media_list
    assert @client.comments.media(@media_id, :page => 1).is_a?(Whatser::Response)
  end  
  
  def test_create
    assert @client.comments.create('poi', @poi_id, 'testing.').is_a?(Whatser::Response)
  end
  
  def test_delete
    assert @client.comments.delete(@poi_id).is_a?(Whatser::Response)
    assert @comment.delete.is_a?(Whatser::Response)
  end  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
whatser-0.6.1 test/test_comment.rb
whatser-0.6.0 test/test_comment.rb
whatser-0.5.0 test/test_comment.rb