mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 02:04:33 +08:00
Change method to Cucumber step
This commit is contained in:
parent
8432db26a4
commit
6cddcc2ea2
2 changed files with 4 additions and 7 deletions
|
@ -1,21 +1,22 @@
|
|||
# Tasks
|
||||
|
||||
def visit_task_page(task_name) # /modules/:id/
|
||||
Given("I'm on the Protocols page of a {string} task") do |task_name|
|
||||
m = MyModule.find_by(name: task_name)
|
||||
visit protocols_my_module_path(m)
|
||||
end
|
||||
|
||||
def visit_task_results_page(task_name) # /modules/:id/results
|
||||
Given("I'm on the Protocols result page of a {string} task") do |task_name|
|
||||
m = MyModule.find_by(name: task_name)
|
||||
visit results_my_module_path(m)
|
||||
end
|
||||
|
||||
def visit_task_archived_results_page(task_name) # /modules/:id/archive
|
||||
Given("I'm on the Protocols result archived page of a {string} task") do |task_name|
|
||||
m = MyModule.find_by(name: task_name)
|
||||
visit archive_my_module_path(m)
|
||||
end
|
||||
|
||||
|
||||
# Change methods to steps
|
||||
# Settings
|
||||
def visit_profile_page
|
||||
visit edit_user_registration_path
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
Given("I'm on the Protocols page of a {string} task") do |task_name|
|
||||
visit_task_page(task_name)
|
||||
end
|
||||
|
||||
Then(/^I should see "([^"]*)" attachment on "([^"]*)" step$/) do |file, step_name|
|
||||
wait_for_ajax
|
||||
expect(find('.step', text: step_name)).to have_content(file)
|
||||
|
|
Loading…
Reference in a new issue