diff options
Diffstat (limited to 'spec/models/cycle_analytics/review_spec.rb')
-rw-r--r-- | spec/models/cycle_analytics/review_spec.rb | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/spec/models/cycle_analytics/review_spec.rb b/spec/models/cycle_analytics/review_spec.rb index 8530d70a38e..867a90d6258 100644 --- a/spec/models/cycle_analytics/review_spec.rb +++ b/spec/models/cycle_analytics/review_spec.rb @@ -6,27 +6,6 @@ describe 'CycleAnalytics#review', feature: true do let(:user) { create(:user, :admin) } subject { CycleAnalytics.new(project, from: from_date) } - def create_merge_request_closing_issue(issue) - source_branch = random_git_name - project.repository.add_branch(user, source_branch, 'master') - sha = project.repository.commit_file(user, random_git_name, "content", "commit message", source_branch, false) - project.repository.commit(sha) - - opts = { - title: 'Awesome merge_request', - description: "Fixes #{issue.to_reference}", - source_branch: source_branch, - target_branch: 'master' - } - - MergeRequests::CreateService.new(project, user, opts).execute - end - - def merge_merge_requests_closing_issue(issue) - merge_requests = issue.closed_by_merge_requests - merge_requests.each { |merge_request| MergeRequests::MergeService.new(project, user).execute(merge_request) } - end - generate_cycle_analytics_spec(phase: :review, data_fn: -> (context) { { issue: context.create(:issue, project: context.project) } }, start_time_conditions: [["merge request that closes issue is created", -> (context, data) { context.create_merge_request_closing_issue(data[:issue]) }]], |