Ruby on Rails
Friday, June 3, 2016
Hi, all! I am very new to Ruby and working my way through a course and have a reached a point where I cannot figure out what I'm doing wrong.
Here is a link to my project on GitHub. When running the /rspec/controllers/users_controller_spec.rb, I receiving the following:
Pending: (Failures listed here are expected and do not affect your suite's status)
1) UsersController PUT #update with valid params updates the requested user
# Add a hash of attributes valid for your model
# ./spec/controllers/users_controller_spec.rb:125
Failures:
1) UsersController PUT #update with invalid params re-renders the 'edit' template
Failure/Error: expect(response).to render_template("edit")
expecting <"edit"> but rendering with <[]>
# ./spec/controllers/users_controller_spec.rb:156:in `block (4 levels) in <top (required)>'
2) UsersController POST login renders the login view if params invalid
Failure/Error: expect(response).to render_template("login")
expecting <"login"> but rendering with <[]>
# ./spec/controllers/users_controller_spec.rb:202:in `block (3 levels) in <top (required)>'
3) UsersController POST login populates the @error variable if params invalid
Failure/Error: expect(assigns[:errors].present?).to be(true)
expected true
got false
# ./spec/controllers/users_controller_spec.rb:209:in `block (3 levels) in <top (required)>'
Finished in 1.92 seconds (files took 19.08 seconds to load)
20 examples, 3 failures, 1 pending
Failed examples:
rspec ./spec/controllers/users_controller_spec.rb:153 # UsersController PUT #update with invalid params re-renders the 'edit' template
rspec ./spec/controllers/users_controller_spec.rb:198 # UsersController POST login renders the login view if params invalid
rspec ./spec/controllers/users_controller_spec.rb:205 # UsersController POST login populates the @error variable if params invalid
-- Here is a link to my project on GitHub. When running the /rspec/controllers/users_controller_spec.rb, I receiving the following:
Pending: (Failures listed here are expected and do not affect your suite's status)
1) UsersController PUT #update with valid params updates the requested user
# Add a hash of attributes valid for your model
# ./spec/controllers/users_
Failures:
1) UsersController PUT #update with invalid params re-renders the 'edit' template
Failure/Error: expect(response).to render_template("edit")
expecting <"edit"> but rendering with <[]>
# ./spec/controllers/users_
2) UsersController POST login renders the login view if params invalid
Failure/Error: expect(response).to render_template("login")
expecting <"login"> but rendering with <[]>
# ./spec/controllers/users_
3) UsersController POST login populates the @error variable if params invalid
Failure/Error: expect(assigns[:errors].
expected true
got false
# ./spec/controllers/users_
Finished in 1.92 seconds (files took 19.08 seconds to load)
20 examples, 3 failures, 1 pending
Failed examples:
rspec ./spec/controllers/users_
rspec ./spec/controllers/users_
rspec ./spec/controllers/users_
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/94c8ccc4-6d88-41b9-850b-f7af9466956f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment