Rails Paths
new post
ensures that the form route works with the /new action (FAILED - 1)Failures:1) new post ensures that the form route works with the /new action
Failure/Error: visit new_post_path
NameError:
undefined local variable or method `new_post_path' for #<RSpec::ExampleGroups::NewPost:0x00007fc40eb275a8>
Did you mean? new_polymorphic_path
# ./spec/features/post_spec.rb:5:in `block (2 levels) in <top (required)>'Finished in 0.00152 seconds (files took 1.56 seconds to load)
1 example, 1 failureFailed examples:rspec ./spec/features/post_spec.rb:4 # new post ensures that the form route works with the /new actionFailure number 1 tells us that
> Failure/Error: visit new_post_path<.
This is the error, we have no way to visit the new_post_path. So in this error that is what we see.
> undefined local variable or method `new_post_path’ for #<
this is telling us that we have an undefined variable for or method for the new post path for our route.
>rspec ./spec/features/post_spec.rb:4 # new post ensures that the form route works with the /new action<
our spec is telling us that the new post path ensures that the route form works with /new or :new *BELOW*


new post
ensures that the form route works with the /new action (FAILED - 1)Failures:1) new post ensures that the form route works with the /new action
Failure/Error: visit new_post_path
AbstractController::ActionNotFound:
The action 'new' could not be found for PostsControllerOnce we add in the /new post path we run our code to check again we get
> Failure/Error: visit new_post_path< >AbstractController::ActionNotFound:
The action ‘new’ could not be found for PostsController<
This is telling us we need to update our PostsController So lets add a new action to our PostsController!
def new
end
ABOVE
this gives our route a connection with our controller and complete that test.
Capsules-MacBook-Pro:rails-form_tag-readme-onl01-seng-pt-052620 capsule$ LEARNnew post
pass ensures that the form route works with the /new action
fail renders HTML in the /new template (FAILED - 1)Failures:1) new post renders HTML in the /new template
Failure/Error: expect(page).to have_content('Post Form')
expected to find text "Post Form" in ""
# ./spec/features/post_spec.rb:11:in `block (2 levels) in <top (required)>'Finished in 0.30258 seconds (files took 1.37 seconds to load)
2 examples, 1 failureFailed examples:rspec ./spec/features/post_spec.rb:9 # new post renders HTML in the /new template
So now we need to
>renders HTML in the /new template (FAILED — 1)<
