Sha256: 365c4b1c48d376da62ac9139e4b345033545797949d4da7279f9706ab9b536f7

Contents?: true

Size: 894 Bytes

Versions: 4

Compression:

Stored size: 894 Bytes

Contents

require 'rspec'
require 'spec_helper'

describe Scraper::Comics do
  describe "Scraping the site" do
    before(:each) do
      @comics = Scraper::Comics.all(1,1)
    end

    it "should return 15 comics for first page" do
      expect(@comics.count).to eq(15)
    end
  end

  describe "Scraping a comic" do
    before(:all) do
      @comic = Scraper::Comics.all(1,1).first
    end

    it "should always return a title" do
      puts @comic.title
      expect(@comic.title).not_to be_empty
    end

    it "should always return a url" do
      puts @comic.url
      expect(@comic.url).not_to be_empty
    end

    it "should always return a main_image" do
      puts @comic.main_image
      expect(@comic.main_image).not_to be_empty
    end

    it "should always return a download_link" do
      puts @comic.download_link
      expect(@comic.download_link).not_to be_empty
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ascraper-0.0.4 spec/comics_spec.rb
ascraper-0.0.3 spec/comics_spec.rb
ascraper-0.0.2 spec/comics_spec.rb
ascraper-0.0.1 spec/comics_spec.rb