Skip to content

Instantly share code, notes, and snippets.

@jakcharlton
Created April 8, 2012 05:08
Show Gist options
  • Save jakcharlton/2334892 to your computer and use it in GitHub Desktop.
Save jakcharlton/2334892 to your computer and use it in GitHub Desktop.
describe ProgramsController do
let(:programs) { [mock_model(Program)] }
describe "GET index" do
it { should paginate(Program).with_default_per_page(30) }
describe "after pagination" do
before(:each) do
Program.stub(:paginate).and_return(programs)
get :index
end
it { should assign_to(:programs).with(programs) }
it { should respond_with(:success) }
it { should render_template(:index) }
it { should_not set_the_flash }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment