Commit 1c4295a
Changed files (2)
app
controllers
spec
controllers
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)