Sha256: 7a8b1238b8ad12ad0fa2ce96d6970e1b55d11b7ea25049f5349618300fbb74a8

Contents?: true

Size: 894 Bytes

Versions: 5

Compression:

Stored size: 894 Bytes

Contents

require 'helper'

class TestDetail < Test::Unit::TestCase
  def setup
    @client = Whatser::Client.new
    @poi_id = 1
    @params = {:rating => 'four stars', :hours => '9-5'}
    @detail = Whatser::Detail.new(:poi_id => @poi_id, :data => @params)
  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, :data => @params).is_a?(Whatser::Response)
  end
  
  def test_delete
    assert @client.reviews.delete(@poi_id, :data => @params).is_a?(Whatser::Response)
  end  
  
  def test_save
    assert @detail.save.is_a?(Whatser::Response)
  end
  
  def test_update
    @detail.id = 1
    assert @detail.save.is_a?(Whatser::Response)
  end  
    
  def test_to_params
    params = [:data]
    params.each do |p|
      assert @detail.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_detail.rb
whatser-0.3.2 test/test_detail.rb
whatser-0.3.1 test/test_detail.rb
whatser-0.3.0 test/test_detail.rb
whatser-0.2.0 test/test_detail.rb