I'm trying to test my SessionsCotroller and have written the following:
describe "POST create session" do
it "should create a new session" do
params = { session: { email: '[email protected]', password: 'foobar' } }
post '/api/signin', params
response['success'] == true
end
...
end
And I'm getting the following error:
Failure/Error: post '/api/signin', params
ActionController::UrlGenerationError:
No route matches {:action=>"/api/signin", :controller=>"sessions", :session=>{:email=>"[email protected]", :password=>"foobar"}}
What am I doing wrong here?
routes.rbfile? Have you tried mocking the requests? (Webmock)routes.rband I don't know how to mock the requests... Would you be able to give an example?