Sha256: a9f0fbfe9199aac5930a19d2a00c237b43dc565caa7eb7f383d0684ae1a11550

Contents?: true

Size: 723 Bytes

Versions: 1

Compression:

Stored size: 723 Bytes

Contents

ENV['RAILS_ENV'] ||= 'test'
require 'coveralls'
Coveralls.wear!

require 'test/unit'
require 'openseek-api-gem'

class AuthenticationTest < Test::Unit::TestCase
  include Fairdom::OpenbisApi

  def setup
    @as_endpoint = 'https://openbis-api.fair-dom.org/openbis/openbis'
    @username = 'apiuser'
    @password = 'apiuser'
  end

  def test_successful_authentication
    au = Authentication.new(@username, @password, @as_endpoint)
    session_token = au.login
    assert_not_nil session_token['token']
  end

  def test_failed_authentication
    invalid_password = 'blabla'
    au = Authentication.new(@username, invalid_password, @as_endpoint)
    assert_raise OpenbisQueryException do
      au.login
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
openseek-api-0.9.1 test/authentication_test.rb