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:12:10 +0300
committerStan Hu <stanhu@gmail.com>2018-07-31 21:12:10 +0300
commit710d82104d457ff40cc820e5953f8cd8777c49d1 (patch)
treeac3b4307897bb3a35be865842c74d6c58627d8ff /spec/lib
parent89d164fbe9097248342b05850ee5edc9ed997ab8 (diff)
Track parental relationships in comments
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/bitbucket_server/representation/comment_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/lib/bitbucket_server/representation/comment_spec.rb b/spec/lib/bitbucket_server/representation/comment_spec.rb
index a989338a317..53a20a1d80a 100644
--- a/spec/lib/bitbucket_server/representation/comment_spec.rb
+++ b/spec/lib/bitbucket_server/representation/comment_spec.rb
@@ -34,5 +34,22 @@ describe BitbucketServer::Representation::Comment do
it { expect(subject.comments.count).to eq(4) }
it { expect(subject.comments).to all( be_a(described_class) ) }
it { expect(subject.comments.map(&:note)).to match_array(["Hello world", "Ok", "hello", "hi"]) }
+
+ # The thread should look like:
+ #
+ # is this a new line? (subject)
+ # -> Hello world (first)
+ # -> Ok (third)
+ # -> Hi (fourth)
+ # -> hello (second)
+ it 'comments have the right parent' do
+ first, second, third, fourth = subject.comments[0..4]
+
+ expect(subject.parent_comment).to be_nil
+ expect(first.parent_comment).to eq(subject)
+ expect(second.parent_comment).to eq(subject)
+ expect(third.parent_comment).to eq(first)
+ expect(fourth.parent_comment).to eq(first)
+ end
end
end