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 trialgerald blady
9,052 PointsAt 5:43 won't test, showing weird error message >>
The first test of bin/rspec spec/features/todo_lists/create_spec.rb passes no problem...
BUT when i run bin/rspec spec/features/todo_lists/edit_spec.rb in terminal it seems as if the test isn't running as i'm receiving the following error message.
Jerrys-MacBook-Pro:odot jerryblady$ bin/rspec spec/features/todo_lists/edit_spec.rb
/Users/jerryblady/.rvm/gems/ruby-2.1.2/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `load': /Users/jerryblady/Source/projects/odot/spec/features/todo_lists/edit_spec.rb:22: syntax error, unexpected keyword_end, expecting end-of-input (SyntaxError)
from /Users/jerryblady/.rvm/gems/ruby-2.1.2/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `block in load_spec_files'
from /Users/jerryblady/.rvm/gems/ruby-2.1.2/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `each'
from /Users/jerryblady/.rvm/gems/ruby-2.1.2/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `load_spec_files'
from /Users/jerryblady/.rvm/gems/ruby-2.1.2/gems/rspec-core-2.99.2/lib/rspec/core/command_line.rb:18:in `run'
from /Users/jerryblady/.rvm/gems/ruby-2.1.2/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:103:in `run'
from /Users/jerryblady/.rvm/gems/ruby-2.1.2/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:17:in `block in autorun'
It looks like it's pointing to edit_spec.rb line 22 which is just the end of the code i'll paste below.
require 'spec_helper'
describe "Editing todo lists" do
it "updates a 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"
todo_list.reload
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
Any help would be amazing!!
1 Answer
Geoff Parsons
11,679 PointsLooks like you're missing a do
after your it
declaration on line 4.
gerald blady
9,052 Pointsgerald blady
9,052 PointsThanks Geoff,
Crazy what another set of eyes does!
Geoff Parsons
11,679 PointsGeoff Parsons
11,679 PointsI hear ya gerald blady! The syntax errors from an unclosed block are a nightmare sometimes since the best line number it can give you is often the end of the file.