Sha256: 98b59b6dc73f7ba5533af60772f1e617cdb9d888012ff7cec8864d26dac31b63

Contents?: true

Size: 1.12 KB

Versions: 2

Compression:

Stored size: 1.12 KB

Contents

require 'test_helper'

class LandsliderTest < Test::Unit::TestCase

	def test_landslider_login
		result = Landslider.login('LOGINTOKEN=' + LS_INSTANCE_NAME)
		
		assert_not_nil result
		assert_equal false, result[:error]
		assert_not_nil result[:session_id]
	end
	
	def test_landslider_get_api_version
		result = Landslider.login('LOGINTOKEN=' + LS_INSTANCE_NAME)
		result = Landslider.get_api_version(result[:session_id])
		
		assert_not_nil result
		assert_operator result[:major_version], :>=, 2
		assert_operator result[:minor_version], :>=, 0
		assert_operator result[:revision_version], :>=, 0
	end
	
	def test_get_accounts
		result = Landslider.login('LOGINTOKEN=' + LS_INSTANCE_NAME)
		result = Landslider.get_accounts(result[:session_id])
		assert_equal false, result[:error]
		assert_not_nil result[:accounts]
		assert result[:accounts].all? { |a| !a[:account_name].nil? }, "account name required"
		assert_operator result[:results_returned], :>=, 0
		assert_operator result[:total_results_available], :>=, 0
		assert_not_nil result[:result_msg]
	end
	

	private

	def login(session_id)
		Landslider.login(session_id)
	end
	

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
landslider-0.2.0 test/landslider_test.rb
landslider-0.1.0 test/landslider_test.rb