Я запускаю тест на огурцы в моем приложении rails. Я пытаюсь войти на страницу с помощью нажатия кнопки. В тесте я прохожу шаги входа в систему и нажимаю кнопку, а затем проверяю текст, чтобы увидеть, соответствует ли он тому, что должно быть на странице после нажатия кнопки. Мне не повезло
.html-код выглядит как
<% 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>
Мой тест выглядит как
Given I am logged in as an admin user
And I should see "admin@member.com"
And I should see "Test Member"
And I should see "Create Member"
And I should see "Create Committee"
С помощью этого шага в моих файлах веб-шагов
Given(/^I am logged in as an admin user$/) do
visit '/sessions/new'
page.should have_content('Log in')
page.should have_content('Note: authentication currently supports both a TAMU NetID or the use of CAS.')
page.should have_content('To access the CAS authentication system, click here')
fill_in 'session_username' , :with => 'admin'
click_button 'Log in'
expect(page).to have_content 'Admin Member'
конец
Но я продолжаю получать эту ошибку
expected to find text "Admin Member" in "MembershipHub\nHome About Help Login\nNo member found with that NetID\nLog in\nNote: authentication currently supports both a TAMU NetID or the use of CAS.\nTo access the CAS authentication system, click here\nNetid\nAbout Help Members SEC Main Site RegistrationHub FinanceHub (Alpha)" (RSpec::Expectations::ExpectationNotMetError)
./features/step_definitions/web_steps.rb:140:in `/^(?:|I )should see "([^"]*)"$/'
features/IterationTwo_adminMember_testing.feature:6:in `Then I should see "Admin Member"'
Какой текст отображается на странице входа в систему. Я не уверен, почему я не вижу страницу после нажатия кнопки входа в систему.