ユーザー認証をゼロからdevise gemに変換中です。すべてが完了し、正常に動作しているようです。rspec テストを変更しましたが、解決策を見つけるために検索した繰り返しの問題が 1 つあります。
エラー
2) AuthenticationPages authorization for non-signed-in users when attempting to visit a    protected page after signing in should render the desired protected page
     Failure/Error: fill_in :email,    with: user.email
     Capybara::ElementNotFound:
       cannot fill in, no text field, text area or password field with id, name, or label     'email' found
     # (eval):2:in `fill_in'
     # ./spec/requests/authentication_pages_spec.rb:53:in `block (5 levels) in <top (required)>'
テスト
describe "for non-signed-in users" do
    let(:user) { FactoryGirl.create(:user)}
    describe "when attempting to visit a protected page" do
        before do
            visit edit_user_registration_path(user)
            fill_in "Email",    with: user.email
            fill_in "Password", with: user.password
            click_button "Sign in"
        end
        describe "after signing in" do
            it "should render the desired protected page" do
                page.should have_selector('title', text: 'Edit user')
            end
        end
    end
Devise フォーム (new_user_session - ユーザー情報の編集を許可される前に表示されます)
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
  <%= f.label :email %>
  <%= f.email_field :email, :autofocus => true %>
  <%= f.label :password %>
  <%= f.password_field :password %>
  <% if devise_mapping.rememberable? -%>
    <%= f.check_box :remember_me %> <%= f.label :remember_me %> 
  <% end -%>
  <%= f.submit "Sign in", class: "btn btn-large btn-primary" %>
<% end %>
<%= render "devise/shared/links" %>
ブラウザでテストすると、動作は実際には正しく機能しますが、rspec テストは失敗します。