में इस कदम को विभाजित कर सकते हैं यहाँ है कैसे मैं यह कर।
Given /^I have one\s+user "([^\"]*)" with email "([^\"]*)" and password "([^\"]*)"$/ do |username,email, password|
@user = User.new(:email => email,
:username=>username,
:password => password,
:password_confirmation => password)
@user.save!
end
Given /^I am an authenticated user$/ do
name = 'exmample'
email = '[email protected]'
password = 'secret!'
Given %{I have one user "#{name}" with email "#{email}" and password "#{password}"}
And %{I go to the user login page}
And %{I fill in "user_username" with "#{name}"}
And %{I fill in "user_password" with "#{password}"}
And %{I press "Sign in"}
end
कारण मैं इसे इस तरह करते हैं,
पता है कि प्रमाणीकरण सिस्टम प्रयोग कर रहे करने की आवश्यकता है कि मैं पूरे ढेर के माध्यम से चलाने के लिए और पर्यावरण तरीका एक सामान्य उपयोगकर्ता होगा की स्थापना की है ... –