Sha256: 06c998449cebd057189ec34b116fd55afeb1e76d741717e00b56d3c194f3fe47

Contents?: true

Size: 780 Bytes

Versions: 1

Compression:

Stored size: 780 Bytes

Contents

 describe 'Leagues' do 
   before(:all) { savon.mock!   }
   after(:all)  { savon.unmock! }

   before(:all) do
   	@client = Xmlsoccer::Client.new(api_key: "12345", api_type: 'Full')
   end

   describe "GetAllLeagues" do

   	before(:each) do
   	  message = {"ApiKey" => @client.api_key}
      fixture = File.read("spec/fixtures/request_manager/get_all_leagues.xml")
      response = {code: 200, headers: {}, body: fixture}
      savon.expects(:get_all_leagues).with(message: message).returns(response)
      @response = @client.get_all_leagues
   	end

   	it 'returns an array' do
     expect(@response).to be_an_instance_of(Array)
    end
    
    it 'responds to league attributes' do
      expect(@response).to include(HashedResponses::GetAllLeagues)
    end

   end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
xmlsoccer-0.1.0 spec/features/leagues_spec.rb