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! While you're at it, check out some resources Treehouse students have shared here.

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 Viewing Todo Items: Part 2

Asa Smith
Asa Smith
10,009 Points

rspec 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
STAFF
Justin Horner
Treehouse Guest Teacher

Hello 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
Asa Smith
10,009 Points

Ah. Always something simple. Thanks for the help Justin.