summaryrefslogtreecommitdiff
path: root/spec/helpers/notes_helper_spec.rb
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-09-05 16:49:05 +0100
committerSean McGivern <sean@gitlab.com>2017-09-06 10:08:03 +0100
commite8f29569bcb4a2d732a2c00b34958f58d5622836 (patch)
tree41b69a559246c423699c741d2f9f252911a2e525 /spec/helpers/notes_helper_spec.rb
parentac816d90d4cc116117497479f400211a43db6be1 (diff)
downloadgitlab-ce-e8f29569bcb4a2d732a2c00b34958f58d5622836.tar.gz
Resolve outdated diff discussions on push
Diffstat (limited to 'spec/helpers/notes_helper_spec.rb')
-rw-r--r--spec/helpers/notes_helper_spec.rb20
1 files changed, 19 insertions, 1 deletions
diff --git a/spec/helpers/notes_helper_spec.rb b/spec/helpers/notes_helper_spec.rb
index 9921ca1af33..68540dd4e59 100644
--- a/spec/helpers/notes_helper_spec.rb
+++ b/spec/helpers/notes_helper_spec.rb
@@ -231,7 +231,7 @@ describe NotesHelper do
end
end
- describe '#form_resurces' do
+ describe '#form_resources' do
it 'returns note for personal snippet' do
@snippet = create(:personal_snippet)
@note = create(:note_on_personal_snippet)
@@ -266,4 +266,22 @@ describe NotesHelper do
expect(noteable_note_url(note)).to match("/#{project.namespace.path}/#{project.path}/issues/#{issue.iid}##{dom_id(note)}")
end
end
+
+ describe '#discussion_resolved_intro' do
+ context 'when the discussion was resolved by a push' do
+ let(:discussion) { double(:discussion, resolved_by_push?: true) }
+
+ it 'returns "Automatically resolved"' do
+ expect(discussion_resolved_intro(discussion)).to eq('Automatically resolved')
+ end
+ end
+
+ context 'when the discussion was not resolved by a push' do
+ let(:discussion) { double(:discussion, resolved_by_push?: false) }
+
+ it 'returns "Resolved"' do
+ expect(discussion_resolved_intro(discussion)).to eq('Resolved')
+ end
+ end
+ end
end