I've overridden Refinery's session controller and not even modified it yet, as I'm trying to write some specs for it.
The controller lives in app/controllers/refinery/sessions_controller:
module Refinery
class SessionsController < Devise::SessionsController
....
def create
super
rescue ::BCrypt::Errors::InvalidSalt, ::BCrypt::Errors::InvalidHash
flash[:error] = t('password_encryption', :scope => 'refinery.users.forgot')
redirect_to refinery.new_refinery_user_password_path
end
.....
I then am trying to write a spec against this in spec/controllers/refinery/sessions_controller_spec.rb:
require 'spec_helper'
describe Refinery::SessionsController do
it "should post ok" do
post :create
response.should be_success
end
end
However this is giving me an error
No route matches {:action=>"create", :controller=>"refinery/sessions"}
This confuses me as when I run rake routes, I get the following line:
refinery_user_session POST /refinery/users/login(.:format) refinery/sessions#create
Could anyone help?
Rails 3.2.8, refinery 2.0.8