Hello,
I am trying to write some tests using Rspec with Rodauth.
Here is what I have:
In a rspec helper:
def sign_in(user)
visit "/login"
fill_in "login", with: user.email
fill_in "password", with: user.password
click_on "Login"
end
rspec controller test:
let(:user) { create(:user) }
before(:each) do
sign_in(user)
end
describe 'GET index' do
it "responds successfully" do
get :show
expect(response).to be_success
end
end
So, all I am doing is trying to sign in a user since this is blocked by authentication. However, using capybara and filling in the fields doesn't work and throws the following error:
KeyError:
key not found: "rodauth"
# /usr/local/bundle/gems/rodauth-rails-0.17.1/lib/rodauth/rails/controller_methods.rb:12:in `fetch'
# /usr/local/bundle/gems/rodauth-rails-0.17.1/lib/rodauth/rails/controller_methods.rb:12:in `rodauth'
Any ideas on what the issue is here?
thanks
--Mike Riley