Week4 pull request 2

please take a look to see if you find any issues.
Ah I understand. I just wasn't sure if Kevin knew that his solutions video was showing too much information. I absolutely agree with you on all counts. And agree that too little information is better than too much. So I play on changing the message I have in my current project so it doesn't say anything about an account or email not being registered in the system. Its a great thought that hadn't occurred to me at all.

Looking forward to week 5.

On Jul 21, 2014, at 10:44 AM, brandoncc <notifications@github.com> wrote:

In spec/controllers/forgot_passwords_controller_spec.rb:
> +      
> +      it "should send an email to the email address" do
> +        post :create, email: "me@example.com"
> +        expect(ActionMailer::Base.deliveries.last.to).to eq ['me@example.com']
> +      end
> +    end
> +    
> +    context "with non existing email" do
> +      it "redirects to the forgot password page" do
> +        post :create, email: 'bogus@email.com'
> +        expect(response).to redirect_to forgot_password_path
> +      end
> +      
> +      it "shows an error message" do
> +        post :create, email: 'bogus@email.com'
> +        expect(flash[:error]).to eq "There is no user with that email in the system."
I know the solutions do it this way. When I was going through the course I don't remember if it was me or another student, but Kevin was asked about this. He said that a success message was a good idea because the less information you give out about your database, the better. Feel free to ask him on the discussion board for confirmation. Just because you are doing it this way in another app as well doesn't make it the right way  . I wasn't trying to say you were wrong in doing it this way, I was just trying to make you think about possibilities. The reason for this is the same reason you want to use tokens so users do not know how many items are in your db. Anyway, good job.
—
Reply to this email directly or view it on GitHub.