diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /spec/features/tags | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/features/tags')
-rw-r--r-- | spec/features/tags/developer_deletes_tag_spec.rb | 27 | ||||
-rw-r--r-- | spec/features/tags/developer_views_tags_spec.rb | 13 |
2 files changed, 24 insertions, 16 deletions
diff --git a/spec/features/tags/developer_deletes_tag_spec.rb b/spec/features/tags/developer_deletes_tag_spec.rb index de9296bc08e..7c4c6f54685 100644 --- a/spec/features/tags/developer_deletes_tag_spec.rb +++ b/spec/features/tags/developer_deletes_tag_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Developer deletes tag' do +RSpec.describe 'Developer deletes tag', :js do let(:user) { create(:user) } let(:group) { create(:group) } let(:project) { create(:project, :repository, namespace: group) } @@ -13,11 +13,12 @@ RSpec.describe 'Developer deletes tag' do visit project_tags_path(project) end - context 'from the tags list page', :js do + context 'from the tags list page' do it 'deletes the tag' do expect(page).to have_content 'v1.1.0' - delete_tag 'v1.1.0' + container = page.find('.content .flex-row', text: 'v1.1.0') + delete_tag container expect(page).not_to have_content 'v1.1.0' end @@ -29,15 +30,15 @@ RSpec.describe 'Developer deletes tag' do expect(current_path).to eq( project_tag_path(project, 'v1.0.0')) - click_on 'Delete tag' + container = page.find('.nav-controls') + delete_tag container - expect(current_path).to eq( - project_tags_path(project)) + expect(current_path).to eq("#{project_tags_path(project)}/") expect(page).not_to have_content 'v1.0.0' end end - context 'when pre-receive hook fails', :js do + context 'when pre-receive hook fails' do before do allow_next_instance_of(Gitlab::GitalyClient::OperationService) do |instance| allow(instance).to receive(:rm_tag) @@ -46,15 +47,17 @@ RSpec.describe 'Developer deletes tag' do end it 'shows the error message' do - delete_tag 'v1.1.0' + container = page.find('.content .flex-row', text: 'v1.1.0') + delete_tag container expect(page).to have_content('Do not delete tags') end end - def delete_tag(tag) - page.within('.content') do - accept_confirm { find("li > .row-fixed-content.controls a.btn-remove[href='/#{project.full_path}/-/tags/#{tag}']").click } - end + def delete_tag(container) + container.find('.js-remove-tag').click + + page.within('.modal') { click_button('Delete tag') } + wait_for_requests end end diff --git a/spec/features/tags/developer_views_tags_spec.rb b/spec/features/tags/developer_views_tags_spec.rb index 4888611472c..6bae53afe6f 100644 --- a/spec/features/tags/developer_views_tags_spec.rb +++ b/spec/features/tags/developer_views_tags_spec.rb @@ -3,6 +3,8 @@ require 'spec_helper' RSpec.describe 'Developer views tags' do + include RepoHelpers + let(:user) { create(:user) } let(:group) { create(:group) } @@ -15,10 +17,13 @@ RSpec.describe 'Developer views tags' do let(:project) { create(:project_empty_repo, namespace: group) } before do - visit project_path(project) - click_on 'Add README' - fill_in :commit_message, with: 'Add a README file', visible: true - click_button 'Commit changes' + project.repository.create_file( + user, + 'README.md', + 'Example readme', + message: 'Add README', + branch_name: 'master') + visit project_tags_path(project) end |