Posso ottenere altri metodi di capibara come visitare, fill_in, selezionare ecc. per funzionare. ma non cliccaPerché ottengo il metodo non definito `clic 'per Cucumber :: Rails :: World? in passi Cucumber/Capybara
Given /^a no fee license called "([^"]*)"$/ do |arg1|
@l = FactoryGirl.create(:license,
name: arg1)
end
When /^execute the license$/ do
visit(license_path(@l))
click('Execute License')
end
errore:
Scenario: no fee license is executed # features/visitor_no_fee_license.feature:14
When I fill out the licensee info with valid info # features/step_definitions/licenses_steps.rb:21
And execute the license # features/step_definitions/licenses_steps.rb:35
undefined method `click' for #<Cucumber::Rails::World:0x007feebad4dec8> (NoMethodError)
./features/step_definitions/licenses_steps.rb:37:in `/^execute the license$/'
features/visitor_no_fee_license.feature:16:in `And execute the license'
No, volevo fare clic perché può selezionare un link o un pulsante. ma il tuo secondo metodo è pulito, grazie! Ho trovato la risposta, pubblicata di seguito. – Ivan