Commit e9699cd9 authored by Sean McGivern's avatar Sean McGivern

Merge branch '59570-tag-quick-action' into 'master'

Move tag quick action spec to shared example

Closes #59570

See merge request gitlab-org/gitlab-ce!26904
parents b57fe50c b87b4d75
...@@ -22,27 +22,6 @@ describe 'Commit > User uses quick actions', :js do ...@@ -22,27 +22,6 @@ describe 'Commit > User uses quick actions', :js do
let(:tag_message) { 'Stable release' } let(:tag_message) { 'Stable release' }
let(:truncated_commit_sha) { Commit.truncate_sha(commit.sha) } let(:truncated_commit_sha) { Commit.truncate_sha(commit.sha) }
it 'tags this commit' do it_behaves_like 'tag quick action'
add_note("/tag #{tag_name} #{tag_message}")
expect(page).to have_content 'Commands applied'
expect(page).to have_content "tagged commit #{truncated_commit_sha}"
expect(page).to have_content tag_name
visit project_tag_path(project, tag_name)
expect(page).to have_content tag_name
expect(page).to have_content tag_message
expect(page).to have_content truncated_commit_sha
end
describe 'preview', :js do
it 'removes quick action from note and explains it' do
preview_note("/tag #{tag_name} #{tag_message}")
expect(page).not_to have_content '/tag'
expect(page).to have_content %{Tags this commit to #{tag_name} with "#{tag_message}"}
expect(page).to have_content tag_name
end
end
end end
end end
# frozen_string_literal: true # frozen_string_literal: true
shared_examples 'tag quick action' do shared_examples 'tag quick action' do
context "post note to existing commit" do
it 'tags this commit' do
add_note("/tag #{tag_name} #{tag_message}")
expect(page).to have_content 'Commands applied'
expect(page).to have_content "tagged commit #{truncated_commit_sha}"
expect(page).to have_content tag_name
visit project_tag_path(project, tag_name)
expect(page).to have_content tag_name
expect(page).to have_content tag_message
expect(page).to have_content truncated_commit_sha
end
end
context 'preview', :js do
it 'removes quick action from note and explains it' do
preview_note("/tag #{tag_name} #{tag_message}")
expect(page).not_to have_content '/tag'
expect(page).to have_content %{Tags this commit to #{tag_name} with "#{tag_message}"}
expect(page).to have_content tag_name
end
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment