diff options
author | Stan Hu <stanhu@gmail.com> | 2018-07-31 21:12:10 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-07-31 21:12:10 +0300 |
commit | 710d82104d457ff40cc820e5953f8cd8777c49d1 (patch) | |
tree | ac3b4307897bb3a35be865842c74d6c58627d8ff /spec/lib/bitbucket_server | |
parent | 89d164fbe9097248342b05850ee5edc9ed997ab8 (diff) |
Track parental relationships in comments
Diffstat (limited to 'spec/lib/bitbucket_server')
-rw-r--r-- | spec/lib/bitbucket_server/representation/comment_spec.rb | 17 |
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 |