3
votes

I looked at other posts regarding this and attempted all tips to fix it but am still getting the error. Can someone look at my code and give me an idea on why this I continue to get this error.

The .html code looks like

<% provide(:title, "Log in") %>
<h1>Log in</h1>

<h2>Note: authentication currently supports both a TAMU NetID or the use of CAS.</h2>
<h2>To access the CAS authentication system, click <%= link_to "here", new_member_session_path %></h2> <br />

<div class="row">
  <div class="col-md-6 col-md-offset-3">
    <%= form_for(:session, url: login_path) do |f| %>

      <%= f.label :netid %>
      <%= f.text_field :username, class: 'form-control' %>

      <%= f.submit "Log in", class: "btn btn-primary" %>
    <% end %>

  </div>
</div>

My test looks like

Background: 
  Given I am on the home page 
  When I follow "Login"
  And I fill in "Netid" with "admin"
  And I press "Log in"

I have trie:

"Netid"
"Member[netid]"
"Member[:netid]"
":netid"
"netid"
1

1 Answers

0
votes

I think you're telling Capybara to fill in the label instead of the input field.

Spin up your Rails app locally and view the source for that page. You should see the field look something like <input type="text" id="session_username" name="session[username]" class="form-control" />.

Try changing "Netid" to the value you see for the id or name there.