Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Relationships

Ricardo Acuna
Ricardo Acuna
9,014 Points

Why does my todo_item_spec.rb is telling me that I didn't pass any arguments?

1) TodoItem Failure/Error: it { should belong_to{:todo_lists} } ArgumentError: wrong number of arguments (0 for 1)

I think to answer this, we'll have to see the relevant code! Looks like we'll need the the code from your TodoItem model test and the TodoItem Model.

1 Answer

Ricardo Acuna
Ricardo Acuna
9,014 Points

I fixed it. I'm using rails 4.1.4, I guess the new version doesn't take a hash just a single param.


it { should belong_to{:todo_list} }


it { should belong_to :todo_list }