" do     visit new_user_registration_path      within "#new_user" do       fill_in "user_email", with: "test@example.com"       fill_in "user_password", with: "000000000"       fill_in "user_password_confirmation", with: "000000000"     end      click_button "Sign up"      if User.devise_modules.include? :confirmable       expect( page.body ).to include( 'A message with a confirmation link has been sent to your email address.' )        body = ActionMailer::Base.deliveries.last.body        md = body.encoded.match /(\/users\/confirmation.*) /       if !md         assert( false, "Confirmation URL not found in message" )       end        visit md[0]        expect( page.body ).to include( "Your email address has been successfully confirmed." )     else       expect( page.body ).to include( "Welcome! You have signed up successfully." )     end      click_link "Profile"   