Sha256: 5b315953e58d2aa6964c535da1c670b13d32cc538a6b3a92abb46a7ad4425c8f

Contents?: true

Size: 883 Bytes

Versions: 2

Compression:

Stored size: 883 Bytes

Contents

require 'spec_helper'

describe Reviewed::Article do
  describe 'find_page' do
    use_vcr_cassette 'article/find_page'

    it 'finds a page with a matching slug' do
      article = Reviewed::Article.find('minden-master-ii-grill-review')
      article.pages.length.should == 4
      article.find_page('performance').should == article.pages[1]
    end
  end

  describe 'attachments' do
    use_vcr_cassette 'article/attachments'

    before(:each) do
      @article = Reviewed::Article.find('big-green-egg-medium-charcoal-grill-review')
    end

    it 'returns all attachments' do
      @article.attachments.length.should > 1
    end

    it 'finds attachments by tag' do
      attachments = @article.attachments('hero')
      attachments.length.should == 1
      attachments.each do |attachment|
        attachment.tags.join(',').should match(/hero/i)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
reviewed-0.0.2 spec/article_spec.rb
reviewed-0.0.1 spec/article_spec.rb