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 Deleting Todo Items

kabir k
PLUS
kabir k
Courses Plus Student 18,036 Points

Different final command line output

Towards the end of the "Deleting Todo Items" video, we I ran the final test that passed, I got a different output from Jason's, even though it passed.

Why am I getting a different outcome, even though, I followed the video exactly?

Here's my final command line output:

treehouse:~/projects/odot (master *) $ git add .
treehouse:~/projects/odot (master +) $ git commit -m "Delete todo list items"
[master d391381] Delete todo list items
 6 files changed, 64 insertions(+), 43 deletions(-)
 create mode 100644 app/views/todo_items/_form.html.erb
 rewrite app/views/todo_items/edit.html.erb (89%)
 rewrite app/views/todo_items/new.html.erb (89%)
 create mode 100644 spec/features/todo_items/delete_spec.rb
treehouse:~/projects/odot (master) $

Here's the final delete_spec.rb file for the video,

require 'spec_helper'

describe "Deleting todo items" do 
    let!(:todo_list) { TodoList.create(title: "Grocery list", description: "Groceries") }
    let!(:todo_item) { todo_list.todo_items.create(content: "Milk") }

    def visit_todo_list(list)
        visit "/todo_lists"
        within "#todo_list_#{list.id}" do
            click_link "List Items"
        end
    end

    it "is successful" do 
        visit_todo_list(todo_list)
        within "#todo_item_#{todo_item.id}" do
            click_link "Delete"
        end
        expect(page).to have_content("Todo list item was deleted.")
        expect(TodoItem.count).to eq(0)
    end
end

2 Answers

Sage Elliott
Sage Elliott
30,003 Points

Hello kabir k, It looks like the code you posted is the input/output from pushing to github. Could you post the test output? One reason it could look different is if you set the Rspec output to: --format documentation

I'm with Sage too - that output is the result of a local git commit, not a test pass/fail.

Steve.