Tests: extract a merge_request_path helper

parent 7e710acc
...@@ -388,13 +388,11 @@ module SharedPaths ...@@ -388,13 +388,11 @@ module SharedPaths
end end
step 'I visit merge request page "Bug NS-04"' do step 'I visit merge request page "Bug NS-04"' do
mr = MergeRequest.find_by(title: "Bug NS-04") visit merge_request_path("Bug NS-04")
visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr)
end end
step 'I visit merge request page "Bug NS-05"' do step 'I visit merge request page "Bug NS-05"' do
mr = MergeRequest.find_by(title: "Bug NS-05") visit merge_request_path("Bug NS-05")
visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr)
end end
step 'I visit merge request page "Bug CO-01"' do step 'I visit merge request page "Bug CO-01"' do
...@@ -503,6 +501,11 @@ module SharedPaths ...@@ -503,6 +501,11 @@ module SharedPaths
Project.find_by!(name: 'Shop') Project.find_by!(name: 'Shop')
end end
def merge_request_path(title)
mr = MergeRequest.find_by(title: title)
namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr)
end
# ---------------------------------------- # ----------------------------------------
# Errors # Errors
# ---------------------------------------- # ----------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment