I\"m using capybara for my integration/acceptance tests. They\'re in /spec/requests/
folder. Now I have a few helper methods that I use during acceptance tests. One
Explicit way with ruby
Using include
:
# spec/support/your_helper.rb
class YourHelper
def register_user(user)
visit home_page
fill_in 'user_name', :with => user.username
fill_in 'password', :with => user.password
click_button 'sign_up_button'
end
end
describe MyRegistration do
include YourHelper
it 'registers an user' do
expect(register_user(user)).to be_truthy
end
end