I can log in to my browser, but Cucumbe cannot log in.
My users / sign _out trace the GET.
functions / step_denfinitions / home_page_steps.rb:
When(/^I am on the homepage$/) do visit root_path end Then (/^I should see "(.*?)"$/) do |t| assert page.has_content?(t) end Given (/^I am signed in$/) do visit ('/users/sign_out') email = ' game@maker.com ' password = 'password' visit '/users/sign_in' fill_in "user_email", :with => email fill_in "user_password", :with => password click_button "Sign in" end And(/^I go to home page$/) do visit root_path end
functions / home_page.feature:
Feature: Home page Scenario: Viewing home page Given I am on the homepage Then I should see "Hello" Scenario: Signed in can create a game Given I am signed in Then I should see "Create Game"
/app/views/welcome/index.html(my root path):
<h1>Welcome#index</h1> "Hello" <p>Find me in app/views/welcome/index.html.erb</p> <% if user_signed_in? %> <<< This works in my browser but not for cucumber <%= link_to "Create Game", new_game_path %> <% end %>
source share