KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Using Rspec with Factory Girl. Trying to check out what data is being assigned in my controller (and test against it). Every post I've read says I should be able to get something out of assigns() but it keeps returning nill Controller def index @stickies = Sticky.where(:user_id => current_user.id) end Spec it "should assign stickies" do foo = assigns(:stickies) puts "foo = #{foo}" end Output foo = Am I using the wrong syntax? Is there a better way to do this? Thanks!!
Tags (comma-separated)
Save Edits
Cancel