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.

Ruby Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Editing Todo Lists

Vishakha Agarwal
Vishakha Agarwal
9,130 Points

Test not passing

I am getting the following message after running the test

/Users/vishakhaagarwal/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in load': /Users/vishakhaagarwal/Documents/Ruby/odot/spec/features/todo_lists/edit_spec.rb:21: syntax error, unexpected keyword_end, expecting end-of-input (SyntaxError) from /Users/vishakhaagarwal/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:inblock in load_spec_files' from /Users/vishakhaagarwal/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in each' from /Users/vishakhaagarwal/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:inload_spec_files' from /Users/vishakhaagarwal/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/rspec-core-2.99.2/lib/rspec/core/command_line.rb:18:in run' from /Users/vishakhaagarwal/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:103:inrun' from /Users/vishakhaagarwal/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:17:in `block in autorun' vishakhas-MBP:odot vishakhaagarwal$

edit_spec.rb looks like this:


require 'spec_helper'

describe "Editing todo lists" do

it "updates todo list successfully with correct information"

    todo_list = TodoList.create(title: "Groceries", description: "Grocery list.")
    visit "/todo_lists"
    within "#todo_list_#{todo_list.id}" do
        click_link "Edit"
    end

    fill_in "Title", with: "New title"
    fill_in "Description", with: "New description"
    click_button "Update Todo list"

    expect(page).to have_content("Todo list was successfully updated")
    expect(todo_list.title).to eq("New title")
    expect(todo_list.description).to eq("New description")

end

end


Please help

2 Answers

You're welcome. Good luck with Rails.

Hello,

It looks like your missing a do statement at the end of your it clause. If you change your code to:

require 'spec_helper'

describe "Editing todo lists" do

it "updates todo list successfully with correct information" do       # <-- Modify this line here to look like this

    todo_list = TodoList.create(title: "Groceries", description: "Grocery list.")
    visit "/todo_lists"
    within "#todo_list_#{todo_list.id}" do
        click_link "Edit"
    end

    fill_in "Title", with: "New title"
    fill_in "Description", with: "New description"
    click_button "Update Todo list"

    expect(page).to have_content("Todo list was successfully updated")
    expect(todo_list.title).to eq("New title")
    expect(todo_list.description).to eq("New description")

end

end

You should be able to get rid of that error. Please let us know if this helps you or if you need more assistance.