Commit 1c4295a

Stephen Peasley <s@stephenpeasley.com>
2015-02-16 15:01:37
Add flash for successful registration
1 parent 4dd4b31
Changed files (2)
app/controllers/registrations_controller.rb
@@ -10,6 +10,7 @@ class RegistrationsController < ApplicationController
     if @user.save
       log_in(@user)
       UserMailer.registration_email(@user).deliver_later # TODO change adapter
+      flash[:notice] = "Thank you for registering. Welcome to Supply Crow."
       redirect_to dashboard_path
     else
       flash.now[:error] = @user.errors.full_messages
spec/controllers/registrations_controller_spec.rb
@@ -44,6 +44,10 @@ describe RegistrationsController do
       it "does not display any errors" do
         expect(flash[:error]).to be_nil
       end
+      
+      it "shows a flash alert" do
+        expect(flash[:notice]).to_not be_empty
+      end
 
       it "sends a user registration email" do
         expect(mailer).to have_received(:deliver_later)