So in my feature file, I have a login background step:
Given /^I login$/ do
user = Factory(:user)
visit '/login'
fill_in("login", :with => user.login)
fill_in("password", :with => user.password)
click_button("Login")
@current_user = user
end
In the next step, I want to be able to include a user_id, but not sure how to get the @current_user that I have logged in.
Given a post exists with name: "My Post", category_id: 3, user_id: ?????
How can I use @current_user to create the correct relationship?
Thanks.