How to write a definition of a cucumber step for registering a page with ref_id in its URL?

I am trying to write a definition of the pitch of a cucumber when a user visits the registration page through a credit referent. The registration page URL contains ref_id, which is actually the referrer user ID. How to write a step definition for -

When / ^ I visit the registration page with ref_id: "([^"] *) "$ / do | arg1 | .... ????? end

+3
source share
1 answer

I understood myself. Here web_step:

When /^I visit sign up page with ref_id "([^"]*)"$/ do |id|
  visit("/users/sign_up?ref_id=#{id}")      
end  
+2
source

Source: https://habr.com/ru/post/1774927/


All Articles