Answer the question
In order to leave comments, you need to log in
How to use session in routing tests in Rspec?
Hello.
When creating a new scaffold controller, rspec automatically creates tests. Among them are routing tests, such as this:
require 'rails_helper'
RSpec.describe CommentsController, type: :routing do
describe 'routing' do
it 'routes to #index' do
expect(get: '/comments').to route_to('comments#index')
end
end
end
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question