Sha256: 5d7e8e0cad1dd8783889a0f97c4fd19588ed122d694a4874f5c95db2cd11f997

Contents?: true

Size: 775 Bytes

Versions: 19

Compression:

Stored size: 775 Bytes

Contents

require File.expand_path('../../test_helper', __FILE__)

module Checkr
  class ApiResourceTest < Test::Unit::TestCase

    should 'have an id attribute' do
      assert(APIResource.method_defined?(:id))
      assert(APIResource.method_defined?(:id=))
    end

    should 'have an object attribute' do
      assert(APIResource.method_defined?(:object))
      assert(APIResource.method_defined?(:object=))
    end

    should 'have a default path' do
      mr = MockResource.new('fake_id')
      assert_equal("#{MockResource.path}/fake_id", mr.path)
    end

    should 'raise an InvalidRequestError when no ID is present for instance path' do
      @mock.expects(:get).never
      c = MockResource.new
      assert_raises(InvalidRequestError) { c.refresh }
    end

  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
checkr-official-1.8.0 test/checkr/api_resource_test.rb
checkr-official-1.7.1 test/checkr/api_resource_test.rb
checkr-official-1.7 test/checkr/api_resource_test.rb
checkr-official-1.6 test/checkr/api_resource_test.rb
checkr-official-1.5.4 test/checkr/api_resource_test.rb
checkr-official-1.5.3 test/checkr/api_resource_test.rb
checkr-official-1.5.2 test/checkr/api_resource_test.rb
checkr-official-1.5.1 test/checkr/api_resource_test.rb
checkr-official-1.5.0 test/checkr/api_resource_test.rb
checkr-official-1.4.0 test/checkr/api_resource_test.rb
checkr-official-1.3.1 test/checkr/api_resource_test.rb
checkr-official-1.2.1 test/checkr/api_resource_test.rb
checkr-official-1.2.0 test/checkr/api_resource_test.rb
checkr-official-1.1.2 test/checkr/api_resource_test.rb
checkr-official-1.1.1 test/checkr/api_resource_test.rb
checkr-official-1.1.0 test/checkr/api_resource_test.rb
checkr-official-1.0.2 test/checkr/api_resource_test.rb
checkr-official-1.0.1 test/checkr/api_resource_test.rb
checkr-official-1.0.0 test/checkr/api_resource_test.rb