Closed
Description
Trying to perform a get or a post Inside a before(:all)
context:
context 'valid request' do
before(:all) do
get 'test'
end
it { expect(response).to be_ok }
it { expect(response.body).to include("success='true'")
end
I get this error:
Failure/Error: get 'test'
RuntimeError:
@routes is nil: make sure you set it in your tests setup method.
Were as this will work in a before(:each)
context (without the intended result)
context 'valid request' do
before(:each) do
get 'test'
end
it { expect(response).to be_ok }
it { expect(response.body).to include("success='true'")
end
This was raised after a discussion over on the rspec mailing list if you want some context as to why you would use this.
Metadata
Metadata
Assignees
Labels
No labels