Sha256: 5f7d954b5e524c27f2b4e0e0247e9302e753cd56ca0c52b7112e1e757296ca9d

Contents?: true

Size: 1.25 KB

Versions: 17

Compression:

Stored size: 1.25 KB

Contents

# coding: utf-8

require 'spec_helper'

describe Article do

  context "TEXT" do
    let(:article) { create(:text_article) }
    it "have valid number of text blocks from page" do
      expect(article.page.content_blocks.count).to eq 1
      expect(article.page.content_blocks.first.class.name).to eq "Redditor::TextBlock"
    end
  end # context "TEXT"

  context "SLIDER" do
    let(:article) { create(:slider_article) }
    it "have valid number of slider blocks from page" do
      expect(article.page.content_blocks.count).to eq 1
      expect(article.page.content_blocks.first.images.count).to eq 3
    end
  end # context "SLIDER"

  context "VIDEO" do
    let(:article) { create(:video_article) }
    it "have valid number of video blocks from page" do
      expect(article.page.content_blocks.count).to eq 1
      expect(article.page.content_blocks.first.class.name).to eq "Redditor::VideoBlock"
    end
  end # context "VIDEO"

  context "FULL" do
    let(:article) { create(:full_article) }
    it "have valid number of blocks from page" do
      expect(article.page.content_blocks.first.position).to eq 1
      expect(article.page.content_blocks.last.position).to eq 3
      expect(article.page.content_blocks.count).to eq 3
    end
  end # context "VIDEO"
  
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
redditor-0.1.17 spec/models/article_spec.rb
redditor-0.1.16 spec/models/article_spec.rb
redditor-0.1.15 spec/models/article_spec.rb
redditor-0.1.14 spec/models/article_spec.rb
redditor-0.1.12 spec/models/article_spec.rb
redditor-0.1.11 spec/models/article_spec.rb
redditor-0.1.10 spec/models/article_spec.rb
redditor-0.1.9 spec/models/article_spec.rb
redditor-0.1.8 spec/models/article_spec.rb
redditor-0.1.7 spec/models/article_spec.rb
redditor-0.1.6 spec/models/article_spec.rb
redditor-0.1.5 spec/models/article_spec.rb
redditor-0.1.4 spec/models/article_spec.rb
redditor-0.1.3 spec/models/article_spec.rb
redditor-0.1.2 spec/models/article_spec.rb
redditor-0.1.1 spec/models/article_spec.rb
redditor-0.1.0 spec/models/article_spec.rb