playable_class_test.rb 1.29 KB
Newer Older
Francis's avatar
Francis committed
1 2 3 4 5 6 7
# frozen_string_literal: true

require 'test_helper'

module BlizzardApi
  module Wow
    class PlayableClassTest < Minitest::Test
8
      def setup
Francis's avatar
Francis committed
9
        @playable_class = BlizzardApi::Wow.playable_class
10 11
      end

Francis's avatar
Francis committed
12
      def test_playable_class_index
13 14
        data = @playable_class.index
        assert_equal 12, data[:classes].count
Francis's avatar
Francis committed
15

16 17
        data = @playable_class.index classic: true
        assert_equal 9, data[:classes].count
Francis's avatar
Francis committed
18 19 20
      end

      def test_playable_class_get
21 22
        data = @playable_class.get 11
        assert_equal 'Druid', data[:name][:en_US]
Francis's avatar
Francis committed
23

24 25
        data = @playable_class.get 11, classic: true
        assert_equal 'Druid', data[:name][:en_US]
Francis's avatar
Francis committed
26 27 28
      end

      def test_playable_class_complete
29 30 31 32 33 34
        data = @playable_class.complete
        assert_equal 'Warrior', data[0][:name][:en_US]

        data = @playable_class.complete classic: true
        assert_equal 'Warrior', data[0][:name][:en_US]
      end
Francis's avatar
Francis committed
35

36 37
      def test_playable_class_talent_slots
        data = @playable_class.talent_slots 11
Francis's avatar
Francis committed
38
        assert_equal 10, data[:talent_slots][0][:unlock_player_level]
Francis's avatar
Francis committed
39 40
      end

41 42 43
      def test_playable_class_media
        data = @playable_class.media 11
        assert_equal 'https://render-us.worldofwarcraft.com/icons/56/classicon_druid.jpg', data[:assets][0][:value]
Francis's avatar
Francis committed
44 45 46 47
      end
    end
  end
end