summaryrefslogtreecommitdiff
path: root/spec/services/preview_markdown_service_spec.rb
diff options
context:
space:
mode:
authorDennis Tang <dennis@dennistang.net>2018-08-20 20:59:11 +0000
committerDennis Tang <dennis@dennistang.net>2018-08-20 20:59:11 +0000
commitfb28b3b375f54a7c14a395eee366cd2509a309be (patch)
tree859f7f3c28cf9012958ae61a834c02e8a0785cd6 /spec/services/preview_markdown_service_spec.rb
parente8c69b9581436e7bae9a5ff882948efdd66f7e3c (diff)
parent5874b2af0ba3710faf2d247e5a63e867e2b5de7a (diff)
downloadgitlab-ce-fb28b3b375f54a7c14a395eee366cd2509a309be.tar.gz
Merge branch '44704-improve-project-overview-ui' into '44704-improve-project-overview-ui-buttons'44704-improve-project-overview-ui-buttons
# Conflicts: # app/assets/stylesheets/pages/projects.scss
Diffstat (limited to 'spec/services/preview_markdown_service_spec.rb')
-rw-r--r--spec/services/preview_markdown_service_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/services/preview_markdown_service_spec.rb b/spec/services/preview_markdown_service_spec.rb
index 81dc7c57f4a..507909d9231 100644
--- a/spec/services/preview_markdown_service_spec.rb
+++ b/spec/services/preview_markdown_service_spec.rb
@@ -65,6 +65,31 @@ describe PreviewMarkdownService do
end
end
+ context 'commit description' do
+ let(:project) { create(:project, :repository) }
+ let(:commit) { project.commit }
+ let(:params) do
+ {
+ text: "My work\n/tag v1.2.3 Stable release",
+ quick_actions_target_type: 'Commit',
+ quick_actions_target_id: commit.id
+ }
+ end
+ let(:service) { described_class.new(project, user, params) }
+
+ it 'removes quick actions from text' do
+ result = service.execute
+
+ expect(result[:text]).to eq 'My work'
+ end
+
+ it 'explains quick actions effect' do
+ result = service.execute
+
+ expect(result[:commands]).to eq 'Tags this commit to v1.2.3 with "Stable release".'
+ end
+ end
+
it 'sets correct markdown engine' do
service = described_class.new(project, user, { markdown_version: CacheMarkdownField::CACHE_REDCARPET_VERSION })
result = service.execute