Skip to content

Instantly share code, notes, and snippets.

@tacoman667
Created September 17, 2012 19:21
Show Gist options
  • Save tacoman667/3739230 to your computer and use it in GitHub Desktop.
Save tacoman667/3739230 to your computer and use it in GitHub Desktop.
wtf?!
class Admin::CampusesController < Admin::BaseController
def index
setup_and_render_index()
end
def setup_and_render_index
@campuses = Campus.all
render :index
end
end
Failure/Error: @controller.should_receive(:setup_and_render_index)
(#<Admin::CampusesController:0x007fa7758c6300>).setup_and_render_index(any args)
expected: 1 time
received: 0 times
describe "GET 'index'" do
it 'assigns @campuses instance variable' do
@controller.should_receive(:setup_and_render_index)
get 'index'
# assigns(:campuses).should eq(Campus.all)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment