Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-07-31 21:33:37 +0300
committerStan Hu <stanhu@gmail.com>2018-07-31 21:33:37 +0300
commit0085b76fb387237af02f717a894c89f7227cb81e (patch)
tree47243df8ac965f643436078f315858190c55950c /spec/lib
parent710d82104d457ff40cc820e5953f8cd8777c49d1 (diff)
Give some context on threaded discussions
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/bitbucket_server_import/importer_spec.rb18
1 files changed, 12 insertions, 6 deletions
diff --git a/spec/lib/gitlab/bitbucket_server_import/importer_spec.rb b/spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
index c7cee15ff36..bba25ae1845 100644
--- a/spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
+++ b/spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
@@ -75,7 +75,9 @@ describe Gitlab::BitbucketServerImport::Importer do
author_email: 'unknown@gmail.com',
comments: [],
created_at: now,
- updated_at: now)
+ updated_at: now,
+ parent_comment: nil)
+
@pr_comment = instance_double(
BitbucketServer::Representation::Activity,
comment?: true,
@@ -115,8 +117,7 @@ describe Gitlab::BitbucketServerImport::Importer do
author_email: 'someuser@gitlab.com',
note: 'I agree',
created_at: now,
- updated_at: now
- )
+ updated_at: now)
# https://gitlab.com/gitlab-org/gitlab-test/compare/c1acaa58bbcbc3eafe538cb8274ba387047b69f8...5937ac0a7beb003549fc5fd26fc247ad
inline_note = instance_double(
@@ -131,7 +132,10 @@ describe Gitlab::BitbucketServerImport::Importer do
author_email: 'unknown@gmail.com',
comments: [reply],
created_at: now,
- updated_at: now)
+ updated_at: now,
+ parent_comment: nil)
+
+ allow(reply).to receive(:parent_comment).and_return(inline_note)
inline_comment = instance_double(
BitbucketServer::Representation::Activity,
@@ -161,7 +165,8 @@ describe Gitlab::BitbucketServerImport::Importer do
expect(start_note.position.new_line).to eq(inline_note.new_pos)
reply_note = notes.last
- expect(reply_note.note).to eq(reply.note)
+ # Make sure reply context is included
+ expect(reply_note.note).to eq("> #{inline_note.note}\n\n#{reply.note}")
expect(reply_note.author).to eq(project.owner)
expect(reply_note.created_at).to eq(reply.created_at)
expect(reply_note.updated_at).to eq(reply.created_at)
@@ -186,7 +191,8 @@ describe Gitlab::BitbucketServerImport::Importer do
author_email: project.owner.email,
comments: [],
created_at: now,
- updated_at: now)
+ updated_at: now,
+ parent_comment: nil)
inline_comment = instance_double(
BitbucketServer::Representation::Activity,