Rspec tests and Rodauth

168 views
Skip to first unread message

Michael Riley

unread,
Mar 22, 2022, 3:28:25 PM3/22/22
to Rodauth
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

Jeremy Evans

unread,
Mar 22, 2022, 4:11:46 PM3/22/22
to rod...@googlegroups.com
Looks like a rodauth-rails issue and not a Rodauth issue, please ask the rodauth-rails developers.

Thanks,
Jeremy 

Michael Riley

unread,
Mar 22, 2022, 4:35:10 PM3/22/22
to rod...@googlegroups.com
Jeremy,

OK, thanks, I'll get in touch with them.

--Mike Riley

--
You received this message because you are subscribed to a topic in the Google Groups "Rodauth" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rodauth/bB3mfLxIGL0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rodauth+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rodauth/CADGZSScH0D5LR0VKqg-WhNNTZPk0c7QhF-ZoxyomCT2vVaUmEg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages