Sha256: 35de46fcb792e7201c3c8d8719d07a0e27688b8bc1e527eacf97da6f33911d2f

Contents?: true

Size: 684 Bytes

Versions: 1

Compression:

Stored size: 684 Bytes

Contents

require 'spec_helper'

describe Popolo::PostsController do
  before :each do
    @routes = Popolo::Engine.routes
    @post = FactoryGirl.create :post
  end

  describe 'GET index' do
    it 'assigns all posts as @posts' do
      get :index
      assigns(:posts).to_a.should == [@post]
      response.should be_success
    end
  end

  describe 'GET show' do
    it 'assigns the requested post as @post' do
      get :show, id: @post.id.to_s
      assigns(:post).should == @post
      response.should be_success
    end

    it 'gets the requested post by slug' do
      get :show, id: @post.slug
      assigns(:post).should == @post
      response.should be_success
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
popolo-0.0.1 spec/controllers/popolo/posts_controller_spec.rb