Adding Users and Roles
Now that we have Devise installed, let’s see how we can use testing to expose security issues.
The most basic security issue is user login. Since our application involves projects that would presumably be limited to a specific, private set of users, it makes sense that you would need to be logged in to access the application. This is testable logic—a logged-in user can access a page, whereas an ordinary browser who happens along the page cannot.
So here’s an integration test for the project index page:
describe "with users and roles" do
fill_in("user_email", :with ...