diff options
author | Pierre de La Morinerie <pierre@capitainetrain.com> | 2015-09-25 19:09:08 +0300 |
---|---|---|
committer | Pierre de La Morinerie <pierre@capitainetrain.com> | 2016-03-03 16:50:12 +0300 |
commit | 566ea8543d971c4b811b2939b0677c5db52feab3 (patch) | |
tree | b7775552d9d8b6ea3a37b4b219e91dd55e2a4aad /features/steps/shared | |
parent | 7e710acc1c72de7d11ad393ee3e111e250e0cb66 (diff) |
Tests: extract a merge_request_path helper
Diffstat (limited to 'features/steps/shared')
-rw-r--r-- | features/steps/shared/paths.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index 6432a786bfc..f7812a707c4 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -388,13 +388,11 @@ module SharedPaths end step 'I visit merge request page "Bug NS-04"' do - mr = MergeRequest.find_by(title: "Bug NS-04") - visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr) + visit merge_request_path("Bug NS-04") end step 'I visit merge request page "Bug NS-05"' do - mr = MergeRequest.find_by(title: "Bug NS-05") - visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr) + visit merge_request_path("Bug NS-05") end step 'I visit merge request page "Bug CO-01"' do @@ -503,6 +501,11 @@ module SharedPaths Project.find_by!(name: 'Shop') 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 # ---------------------------------------- |