Sha256: 22e5c3fcf97a613bf77832071cd13999ec02cf8a65aa5d8d6acab2f5242d174a

Contents?: true

Size: 819 Bytes

Versions: 3

Compression:

Stored size: 819 Bytes

Contents

require 'helper'


describe '.connect' do
  
  before do 
    @uatu = Uatu::Base.new
  end

  it "should prepare options just fine" do
    unrubified = @uatu.prepare_options(format_type: 'comic', date_descriptor: 'lastWeek', limit: 20, character_id: '1009262')

    unrubified[:formatType].must_equal 'comic'
    unrubified[:dateDescriptor].must_equal 'lastWeek'
    unrubified[:limit].must_equal 20
    unrubified[:characterId].must_equal nil
  end

  it "should build normal routes just fine" do
    route = @uatu.build_route('character', {})
    route.must_equal "/v1/public/characters"

    route = @uatu.build_route('characters', {})
    route.must_equal "/v1/public/characters"

    route = @uatu.build_route('character', {character_id: '1009262'})
    route.must_equal "/v1/public/characters/1009262"

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
uatu-marvel-0.0.2 test/uatu/connection_test.rb
uatu-marvel-0.0.1.1 test/uatu/connection_test.rb
uatu-marvel-0.0.1 test/uatu/connection_test.rb