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 trialNelly Nelly
7,134 Pointsdestroy_spec.rb still failing
Sorry me again... There must be something tiny somewhere that I can't find.... my repo is here: https://github.com/knopfler81/odot/tree/user_auth
edit_spec.rb
create_spec.rb
index_spec.rb
are working good....
but destroy_spec.rb
is driving me crazy... What the hell is wrong ?
rspec spec/features/todo_lists/destroy_spec.rb
Deleting todo lists
is successful when clicking the destroy link (FAILED - 1)
Failures:
1) Deleting todo lists is successful when clicking the destroy link
Failure/Error: expect(TodoList.count).to eq(0)
expected: 0
got: 1
(compared using ==)
# ./spec/features/todo_lists/destroy_spec.rb:20:in `block (2 levels) in <top (required)>'
Finished in 0.83766 seconds (files took 1.53 seconds to load)
1 example, 1 failure
Failed examples:
rspec ./spec/features/todo_lists/destroy_spec.rb:13 # Deleting todo lists is successful when clicking the destroy link
here is the destroy_spec.rb
require 'rails_helper'
require 'rspec/active_model/mocks'
require 'database_cleaner'
describe "Deleting todo lists" do
let(:user){ create(:user) }
let!(:todo_list) { TodoList.create(title: "Groceries", description: "Grocery list.")}
before do
sign_in user, password: "treehouse1"
end
it "is successful when clicking the destroy link" do
visit "/todo_lists"
within "#todo_list_#{todo_list.id}" do
click_link "Destroy"
end
expect(page).to_not have_content(todo_list.title)
expect(TodoList.count).to eq(0)
end
end
Thanks if you can help ! maybe Steve Hunter again ?
cheers
ps: I've tried to go further in the lesson, but EVERYTHING fails now....
5 Answers
Steve Hunter
57,712 PointsHi Nelly,
What's in your todo_lists_controller
? There should be a destroy
action in there?
Steve.
Nelly Nelly
7,134 PointsI think I have an older problem, I've noticed that I had failure on my master brach... i though I had fixed that... awww :( so there is something wrong that is pretty old
Steve Hunter
57,712 PointsWhoopsie!
I don't know if I can pull the project - I'll give it a go. I'll 'follow' you on Github too ...
Nelly Nelly
7,134 PointsI will add you on the project :)
Steve Hunter
57,712 PointsI get some pretty spectacular failures!
104 examples, 30 failures and 3 pending.
I think I need to start again, though. I'm not happy that the git branches pulled across properly. I'll have another go later.
Nelly Nelly
7,134 PointsThat's what I have too :( is it easier if I find you on skype?
Steve Hunter
57,712 PointsYeah - message me ... I'm big.dog.consultants
. Just back from a run - need a shower and some food. Back soon!
Nelly Nelly
7,134 PointsSteve Hunter I've sent you a message thanks :)
Nelly Nelly
7,134 PointsNelly Nelly
7,134 Pointsthere is: