Sha256: d863113be194d3f3bf749b5bd8ebe5d38193808f36a84914f3cae9fa8743631a

Contents?: true

Size: 832 Bytes

Versions: 4

Compression:

Stored size: 832 Bytes

Contents

# encoding: utf-8

require 'spec_helper'
require 'battlenet'

describe Battlenet::Character do
  let(:api) { Battlenet.new }

  it "fetches character data" do
    VCR.use_cassette('character_mortawa') do
      character = api.character 'nazjatar', 'mortawa'
      character['level'].should == 85
    end
  end

  it "fetches additional character data" do
    VCR.use_cassette('character_mortawa_titles') do
      character = api.character 'nazjatar', 'mortawa', :fields => 'titles'
      character['titles'].find { |t| t['selected'] == true }['name'].should == "Twilight Vanquisher %s"
    end
  end

  it "fetches characters with non-ASCII characters in their name" do
    VCR.use_cassette('character_nonstandard_name') do
      character = api.character 'nazjatar', 'Hikô'
      character['level'].should == 85
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
battlenet-1.2.0 spec/integration/character_spec.rb
battlenet-1.1.1 spec/integration/character_spec.rb
battlenet-1.1.0 spec/integration/character_spec.rb
battlenet-1.0.0 spec/integration/character_spec.rb