Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Asa Smith
10,009 Pointsrspec syntax error
Can anyone help with this error message?
rb:11: syntax error, unexpected keyword_end, expecting tSTRING_DEND (SyntaxError)
Here is my code for the index_spec.rb file
require 'spec_helper'
describe "Viewing todo items" do
let!(:todo_list) {TodoList.create(title:"Grocery list", description:"Groceries")}
def visit_todo_list(list)
visit "/todo_lists"
within "#todo_list_#{todo_list.id"}" do
click_link "List Items"
end
end
it "displays the title of the todo list" do
visit_todo_list(todo_list)
within("h1") do
expect(page).to have_content(todo_list.title)
end
end
it "displays no items when a todo list is empty" do
visit_todo_list(todo_list)
expect(page.all("ul.todo_items li").size).to eq (0)
end
it "displays item content when a todo list has items" do
end
end
2 Answers

Justin Horner
Treehouse Guest TeacherHello Asa,
Your visit_todo_list function has an extra quotation mark on line 8 after .id. It should look like this.
within "#todo_list_#{todo_list.id}" do
I hope this helps.

Asa Smith
10,009 PointsAh. Always something simple. Thanks for the help Justin.

Justin Horner
Treehouse Guest TeacherYou're welcome!