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 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.