Sha256: 62e1d11599aab87aa2786914f9fa31a36f9c04754c42003f2f64a30bf8b0a108

Contents?: true

Size: 968 Bytes

Versions: 1

Compression:

Stored size: 968 Bytes

Contents

require 'spec_helper'

module Beatport::Catalog
  describe "AudioFormat" do
    describe 'structure' do
      subject do
        VCR.use_cassette('audio_format_all') { AudioFormat.all.first }
      end
     
      it { should be_an(AudioFormat) }
      its (:id) { should == 1 }
      its (:name) { should == "mp3" }
      its (:person_preference_visibility) { should == true }
    end    
  
    describe '.all' do
      subject do
        VCR.use_cassette('audio_format_all') { AudioFormat.all }
      end
      
      its (:length) { should be > 1 }
    end

    describe '.find' do
      context "by id" do
        subject do
          VCR.use_cassette("audio_format_2") { AudioFormat.find(2) }
        end
        its (:name) { should == "m4a" }
      end
      
      context "by name" do
        subject do
          VCR.use_cassette("audio_format_wav") { AudioFormat.find('wav') }
        end
        its (:name) { should == "wav" }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
beatport-0.1.5 spec/catalog/audio_format_spec.rb