diff options
Diffstat (limited to 'spec/controllers/projects/merge_requests')
-rw-r--r-- | spec/controllers/projects/merge_requests/diffs_controller_spec.rb | 20 | ||||
-rw-r--r-- | spec/controllers/projects/merge_requests/drafts_controller_spec.rb | 2 |
2 files changed, 21 insertions, 1 deletions
diff --git a/spec/controllers/projects/merge_requests/diffs_controller_spec.rb b/spec/controllers/projects/merge_requests/diffs_controller_spec.rb index 9905b6ba512..b2b591d7929 100644 --- a/spec/controllers/projects/merge_requests/diffs_controller_spec.rb +++ b/spec/controllers/projects/merge_requests/diffs_controller_spec.rb @@ -625,7 +625,7 @@ RSpec.describe Projects::MergeRequests::DiffsController, feature_category: :code end context 'when ck param is present' do - let(:cache_key) { merge_request.merge_head_diff.id } + let(:cache_key) { 'abc123' } before do create(:merge_request_diff, :merge_head, merge_request: merge_request) @@ -657,5 +657,23 @@ RSpec.describe Projects::MergeRequests::DiffsController, feature_category: :code end end end + + context 'when collapse_generated_diff_files FF is enabled' do + it 'sets generated' do + go + expect(json_response["diff_files"][0]["viewer"]["generated"]).to eq(false) + end + end + + context 'when collapse_generated_diff_files FF is disabled' do + before do + stub_feature_flags(collapse_generated_diff_files: false) + end + + it 'sets generated as nil' do + go + expect(json_response["diff_files"][0]["viewer"]["generated"]).to be_nil + end + end end end diff --git a/spec/controllers/projects/merge_requests/drafts_controller_spec.rb b/spec/controllers/projects/merge_requests/drafts_controller_spec.rb index 505f9f5b19b..cc558aa2d1d 100644 --- a/spec/controllers/projects/merge_requests/drafts_controller_spec.rb +++ b/spec/controllers/projects/merge_requests/drafts_controller_spec.rb @@ -87,6 +87,7 @@ RSpec.describe Projects::MergeRequests::DraftsController, feature_category: :cod end it 'creates a draft note with quick actions' do + stub_commonmark_sourcepos_enabled create_draft_note(draft_overrides: { note: "#{user2.to_reference}\n/assign #{user.to_reference}" }) expect(response).to have_gitlab_http_status(:ok) @@ -354,6 +355,7 @@ RSpec.describe Projects::MergeRequests::DraftsController, feature_category: :cod end it 'publishes a draft note with quick actions and applies them', :sidekiq_inline do + stub_commonmark_sourcepos_enabled project.add_developer(user2) create(:draft_note, merge_request: merge_request, author: user, note: "/assign #{user2.to_reference}") |