Sha256: 605f94336193a4305c28e14e694edea872fc92af2ac301b08c09a024d6737315

Contents?: true

Size: 852 Bytes

Versions: 5

Compression:

Stored size: 852 Bytes

Contents

require 'helper'

class TestReview < Test::Unit::TestCase
  def setup
    @client = Whatser::Client.new
    @poi_id = 1
    @review = Whatser::Review.new(:poi_id => @poi_id, :body => 'four stars')
  end
  
  def test_list
    assert @client.reviews.list(@poi_id, :page => 1).is_a?(Whatser::Response)
  end
  
  def test_create
    assert @client.reviews.create(@poi_id, :body => 'four stars').is_a?(Whatser::Response)
  end
  
  def test_delete
    assert @client.reviews.delete(@poi_id, :body => 'four stars').is_a?(Whatser::Response)
  end  
  
  def test_save
    assert @review.save.is_a?(Whatser::Response)
  end
  
  def test_update
    @review.id = 1
    assert @review.save.is_a?(Whatser::Response)
  end  
    
  def test_to_params
    params = [:body]
    params.each do |p|
      assert @review.to_params.keys.include?(p)
    end
  end  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
whatser-0.4.0 test/test_review.rb
whatser-0.3.2 test/test_review.rb
whatser-0.3.1 test/test_review.rb
whatser-0.3.0 test/test_review.rb
whatser-0.2.0 test/test_review.rb