Capybara :: InfiniteRedirectError: redirected more than 5 times, check for infinite redirects. - edit user

0

I have an error running my user editing tests, it throws me the next exception

Capybara :: InfiniteRedirectError:        redirected more than 5 times, check for infinite redirects.

This is my feature class.

require 'rails_helper'

RSpec.feature "Users", type: :feature do
  context "crear nuevo usuario" do
    scenario "creacion exitosa" do
      user= FactoryBot.create(:user, :super_usuario)
      login_as(user, :scope => :user)
      visit new_user_path
      within('#frm_user') do 
       fill_in('user_user', with: 'elusuario')
       fill_in('user_name', with: 'Jhon Smith')
       fill_in('user_email', with: '[email protected]')
       select('Cliente', from: 'user[roles]')
       fill_in('user_password', with: '123456')
      end
       click_button 'Grabar'
       expect(page).to have_content('Jhon Smith')  
    end  
  end

  context "editar usuario" do

    scenario "edicion exitosa" do
      user= FactoryBot.create(:user, :super_usuario)
      login_as(user, :scope => :user)
      visit edit_user_path(user)
      within('#frm_user') do 
       fill_in('user_user', with: 'marco')
       fill_in('user_name', with: 'Marco Smith')
       fill_in('user_email', with: '[email protected]')
       select('Cliente', from: 'user[roles]')
      end
       click_button 'Grabar'
       expect(page).to have_content('Marco Smith')  
    end  

    scenario "fallo al actualizar" do
    end 
  end

  context "eliminar usuario" do 
  end  
end
    
asked by HalleyRios 04.04.2018 в 00:04
source

0 answers