# -*- coding: utf-8 -*-
require 'spec_helper'

module Onsen

  describe Radio do
    context 'when searching kamosan' do
      it 'should return a title' do
        VCR.use_cassette 'radios/search_kamosan', :match_requests_on => [:host] do
          kamosan = Schedule.search('名塚佳織のかもさん學園')
          
          expect(kamosan.title).to eq('名塚佳織のかもさん學園')
          expect(kamosan.number).to eq(285)
          expect(kamosan.file_url).to eq("http://onsen.b-ch.com/radio/kamo140721G996.mp3")
          expect(kamosan.file_name).to eq("kamo140721G996.mp3")
          expect(kamosan.file_extension).to eq("mp3")          
          expect(kamosan.image_url).to eq("http://www.onsen.ag/program/kamo/image/35_pgi01_s.jpg")
          expect(kamosan.index_url).to eq("http://www.onsen.ag/program/kamo/index.html")

        end
      end
    end
  end
  
end
