Sha256: 8834af2327d1de0e2c4edbe09cdd078f1f12e10defdad592a1acc3d6c97708dd

Contents?: true

Size: 712 Bytes

Versions: 2

Compression:

Stored size: 712 Bytes

Contents

require 'spec_helper'

describe Popolo::PeopleController do
  before :each do
    @routes = Popolo::Engine.routes
    @person = FactoryGirl.create :person
  end

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

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
popolo-0.0.2 spec/controllers/popolo/people_controller_spec.rb
popolo-0.0.1 spec/controllers/popolo/people_controller_spec.rb