Ruby On Rails Lesson
Now it’s time to get the edit form to work. Editing the profile images is already functional since we’ve outsourced image upload to Gravatar; we can edit gravatars by clicking on the ‘‘change’’ link from Figure 9.2, as shown in Figure 9.4. Let’s get the rest of the user edit functionality working as well.
The tests for the update action are similar to those for create. Listing 9.9 shows how to use Capybara to fill in the form fields with valid information and then test that the resulting behavior is correct. This is a lot of code; see if you can work through it by referring back to the tests in Chapter 7.