Sha256: cd6637af35c96ad8fdc31d122a131aed8f443580d707e146afc61d4615430d58

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

describe FilmSnob::Rdio do
  describe "rdio URLs" do
    let(:url) { "http://www.rdio.com/#{path}" }

    context "when the URL is an album" do
      let(:path) { "artist/Sam_Smith/album/In_The_Lonely_Hour/" }

      it "should parse" do
        snob = FilmSnob.new(url)
        expect(snob).to be_embeddable
        expect(snob.site).to eq :rdio
        VCR.use_cassette("rdio/in the lonely hour") do
          expect(snob.title).to eq "In The Lonely Hour"
          expect(snob.html).to include "iframe"
        end
      end
    end

    context "a song" do
      let(:path) do
        "artist/Sam_Smith/album/In_The_Lonely_Hour/track/Stay_With_Me"
      end
      it "should parse normal track rdio URLs" do
        snob = FilmSnob.new(url)
        expect(snob).to be_embeddable
        expect(snob.site).to eq :rdio
        VCR.use_cassette("rdio/stay with me") do
          expect(snob.title).to eq "Stay With Me"
        end
      end
    end

    it "should not allow weak matches for rdio urls" do
      snob = FilmSnob.new("google.com/q=rdio")
      expect(snob).to_not be_embeddable
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
film_snob-1.0.1 spec/film_snob/oembed_providers/rdio_spec.rb
film_snob-1.0.0 spec/film_snob/oembed_providers/rdio_spec.rb