I am building an Rails application where the forgot password feature is
implemented. I need to write the test cases for it using RSpec. I am
very new to RSPEC and got the basic idea of how rspec works from the
tutorial and screencasts. But I am not sure how it can be tested for
controllers. In my controller method if i am retrieving a user from
database, then how would I test it using rspec. Do I give dummy data for
testing rspec.?? Please find the example below.

I think your are confused with acceptance specs and controllers spec. In
a controller spec you must to test only your controller in total
isolation. You can use stubs and mocks to do it. In the acceptance spec
you must to test all the behaviour at a very high level.

I think your are confused with acceptance specs and controllers spec. In
a controller spec you must to test only your controller in total
isolation. You can use stubs and mocks to do it. In the acceptance spec
you must to test all the behaviour at a very high level.

I think to create a record in the database for a feature spec is
correct. You can see an example of my specs here :

From the link above you provided for acceptance testing I understand
that we write test cases for failing conditions first and then write the
code until the tests are passed. But one question that arise in my mind
is that in acceptance testing do we need to write tests for checking
blank values, no or no of chars for password field (like validations)??
For eg, if I am writing test cases for Forgot password feature, then I
write test cases as above what I have written. So as per the test cases
I would write code in controllers/models/views and make the test pass.
But do I also need to write test cases for scenarios like if Email field
is left blank and clicked submit button, then it should fail??