You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 21, 2024. It is now read-only.
The sample code is expecting a true/false response ... update_attributes! raises an exception if it fails. Could you elaborate on why you'd make this change? Thanks.
The reason I did this is because the concrete code used update_attributes! when it was called.
`
def complete
if @project.update_attributes!(completed: true)
flash[:notice] = "Congratulations, this project is complete!"
else
flash[:alert] = "Unable to complete project."
end
redirect_to @project
end
`
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
before do
allow_any_instance_of(Project).to(
receive(:update_attributes).with(completed: true).and_return(false))
end
before do
allow_any_instance_of(Project).to(
receive(:update_attributes!).with(completed: true).and_return(false))
end
The text was updated successfully, but these errors were encountered: