Browse Source

Add flash banner spec and functionality

pull/81/head
baarkerlounger 3 years ago
parent
commit
1a00e880ce
  1. 1
      app/controllers/users/passwords_controller.rb
  2. 6
      spec/requests/users/passwords_controller_spec.rb

1
app/controllers/users/passwords_controller.rb

@ -1,6 +1,7 @@
class Users::PasswordsController < Devise::PasswordsController
def reset_confirmation
@email = params["email"]
flash[:notice] = "Reset password instructions have been sent to #{@email}"
render "devise/confirmations/reset"
end

6
spec/requests/users/passwords_controller_spec.rb

@ -29,5 +29,11 @@ RSpec.describe Users::PasswordsController, type: :request do
follow_redirect!
expect(response.body).to match(/Check your email/)
end
it "shows a flash banner" do
post "/users/password", params: params
follow_redirect!
expect(flash[:notice]).to be_present
end
end
end

Loading…
Cancel
Save