Sha256: f8ffcaad153618a75a4ddec1b2eb416f7b32d58ddba3a1febc66b66b74deaaee

Contents?: true

Size: 1.12 KB

Versions: 5

Compression:

Stored size: 1.12 KB

Contents

require 'helper'

class TestDataSource < Test::Unit::TestCase
  def setup
    @client = Whatser::Client.new(:oauth_token => '1234')
  end
  
  def test_list
    assert @client.data_sources.list(:page => 1).is_a?(Whatser::Response)
  end
  
  def test_for_users_with_id
    assert @client.data_sources.for_users(1, :page => 1).is_a?(Whatser::Response)
  end  

  def test_for_users_with_string
    assert @client.data_sources.for_users('1,2,3', :page => 1).is_a?(Whatser::Response)
  end  

  def test_for_users_with_array
    assert @client.data_sources.for_users([1,2,3], :page => 1).is_a?(Whatser::Response)
  end
    
  def test_subscription_url
    datasource = @client.data_sources.new(:id => '1')
    expected = "#{@client.api_uri}/payments/data_sources/1/orders/new?oauth_token=1234"
    assert_equal expected, datasource.subscription_url
  end
  
  def test_subscription_url_with_params  
    datasource = @client.data_sources.new(:id => '1')
    expected = "#{@client.api_uri}/payments/data_sources/1/orders/new?oauth_token=1234&test=2&extra=1"
    assert_equal expected, datasource.subscription_url(:extra => 1, :test => 2)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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