Sha256: 282d39df922e870677614ff9f2cef23abf6649e1fb8c81c8e8ae635d069c5338

Contents?: true

Size: 1.53 KB

Versions: 1

Compression:

Stored size: 1.53 KB

Contents

require 'spec_helper'

module RapGenius
  describe Song do
    context "given Big Sean's Control", vcr: {cassette_name: "big-sean-control-lyrics"} do
      subject { described_class.new("Big-sean-control-lyrics") }

      its(:url)         { should eq "http://rapgenius.com/Big-sean-control-lyrics" }
      its(:title)       { should eq "Control" }
      its(:artist)      { should eq "Big Sean" }
      its(:description) { should include "blew up the Internet" }
      its(:full_artist) { should include "(Ft. Jay Electronica & Kendrick Lamar)"}

      describe "#images" do
        it "should be an Array" do
          subject.images.should be_an Array
        end

        it "should include Big Sean's picture" do
          subject.images.should include "http://s3.amazonaws.com/rapgenius/1375029260_Big%20Sean.png"
        end
      end

      describe "#annotations" do
        it "should be an Array of Annotation objects" do
          subject.annotations.should be_an Array
          subject.annotations.first.should be_a Annotation
        end

        it "should be of a valid length" do
          # Annotations get added and removed from the live site; we want our
          # count to be somewhat accurate, within reason.
          subject.annotations.length.should be_within(15).of(130)
        end
      end
    end

    describe '.find' do
      it "returns a new instance at the specified path" do
        i = described_class.find("foobar")
        i.should be_a Song
        i.url.should eq 'http://rapgenius.com/foobar'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rapgenius-0.0.3 spec/rapgenius/song_spec.rb