Skip to content

Instantly share code, notes, and snippets.

Created July 14, 2012 18:53
Show Gist options
  • Save anonymous/3112657 to your computer and use it in GitHub Desktop.
Save anonymous/3112657 to your computer and use it in GitHub Desktop.
UserPasswordResetsController
require 'spec_helper'
describe UserPasswordResetsController do
describe 'POST #create' do
before(:each) do
@user = create(:user, customer_id: 1, email: '[email protected]')
end
let(:make_valid_request) { post :create, { email: '[email protected]' } }
let(:make_invalid_request) { post :create, { email: '[email protected]' } }
context 'successful requests' do
it 'sends 1 password reset email to the user' do
User.any_instance.should_receive(:send_password_reset)
make_valid_request
end
it 'render :create template' do
make_valid_request
response.should render_template(:create)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment