if :project_id
if :project_id?
if :project_id.blank?
etc . etc.
But nothing works…
So what is the value of project_id that you are trying to test for?
If you are not sure then have a look at the Rails Guide on debugging
which will show you techniques that you can use to debug your code.
Then you can find out what is the value of project_id and why your
tests are not working.
You said in your initial post that you were testing it in the model.
What do you mean by “parent_id” => “”? In the model it should
probably be an attribute self.parent_id, but in that case I would
expect it to be nil if it is a foreign key.
If you are trying to test it in the controller then it depends what
you are trying to do. Show us the code you have tried (for the
action, not just one line out of context).
Colin
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.