Sha256: aff4a0eca3629daedf7d775f9f0f221e8708bc01f25809859b53e583d7b3f016

Contents?: true

Size: 659 Bytes

Versions: 2

Compression:

Stored size: 659 Bytes

Contents

require 'spec_helper'

describe TheGamesDB::Image::Boxart do

  before do
    game_xml = SpecRoot.join 'fixtures', 'game.xml'
    TheGamesDB::Feed.stubs(:fetch).returns(game_xml.read)
  end

  let(:game)   { TheGamesDB::Game.find 140 }
  let(:boxart) { game.boxarts.first }

  it 'is parsed correctly' do
    boxart.side.should == "front"
    boxart.width.should == 709
    boxart.height.should == 1000
    boxart.path.should == "boxart/original/front/140-1.jpg"
  end

  context '#url' do
    it 'is composed of the base image url and the path' do
      boxart.url.should == 'http://thegamesdb.net/banners/boxart/original/front/140-1.jpg'
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
the_games_db-0.1.0 spec/the_games_db/image/boxart_spec.rb
the_games_db-0.0.1 spec/the_games_db/image/boxart_spec.rb