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 trialsteven alston
16,292 Pointslet(:invalid_attributes) { {"title" =>"", "description" => "" } }
This cleared up several of the pending conflicts in the bin/rake spec test
let(:invalid_attributes) { {"title" =>"", "description" => "" } }
However, I still have conflicts/items pending for the PUT update block for :new_attributes and assertions, any help on what to add here would be appreciated. Thanks!
todo_lists_controller_spec.rb
describe "PUT update" do
describe "with valid params" do
let(:new_attributes) {
{}
}
it "updates the requested todo_list" do
todo_list = TodoList.create! valid_attributes
put :update, {:id => todo_list.to_param, :todo_list => new_attributes}, valid_session
todo_list.reload
skip("Add assertions for updated state")
end
2 Answers
steven alston
16,292 PointsThis cleared all the examples that were pending, except for the ones the were still pending in the video.
todo_lists_controller_spec.rb
let(:valid_attributes) {
{
"title" => "My String",
"description" => "My Description"
}
}
let(:invalid_attributes) {
{
"title" => "",
"description" => ""
}
}
#more describe blocks
describe "PUT update" do
describe "with valid params" do
let(:new_attributes) {
{title: 'updated_title', description: 'updated_description'}
}
it "updates the requested todo_list" do
todo_list = TodoList.create! valid_attributes
put :update, {:id => todo_list.to_param, :todo_list => new_attributes}, valid_session
todo_list.reload
expect(controller.notice).to eq("Todo list was successfully updated.")
end
Maciej Czuchnowski
36,441 PointsAs far as 'pending' is concerned, the whole 'skip' line should not be there. Remove it and see if that helps. When in doubt, look at Jason's code ( http://treehouse-code-samples.s3.amazonaws.com/odot/odot-8.zip ) unless you're using different version or RSpec.
steven alston
16,292 PointsUsing rspec version 3.1.7 I have read other comments from you related to this version. However, I don't want to go through the trouble of reinstalling everything. Do know what arguments could be added to the :new_attributes? Also, what assertions would I need to write? I previously added the <bold> let( :new_attributes) {{title: "updated_title" and description: "updated_description" }}</bold> which cleared the error for that, but it still gave me the error that it needed assertions. Not sure what to add here, or if the :new_attributes was correct? Thanks for your help!