Testing instance variables from controllers with rspec
- by Thiago
Hi,
I am trying to get the following spec to run:
describe BlacklistController, "GET index" do
it "should display the list of universally blocked numbers" do
get :index
debugger
assigns[:blocked_numbers].should contain "190"
end
end
Here's the action
def index
@blocked_numbers << "190"
respond_to do |format|
format.html
end
end
And the failure simply says that assigns[:blocked_numbers} is nil. Why's that?