summaryrefslogtreecommitdiff
path: root/spec/features/projects/files
diff options
context:
space:
mode:
authorJan Provaznik <jprovaznik@gitlab.com>2018-08-12 22:19:35 +0200
committerJan Provaznik <jprovaznik@gitlab.com>2018-08-13 07:35:50 +0200
commit21a8cc2c2a867f44ebe6df8377b0ebe391c2ebb2 (patch)
treebf2bac86eb1c68ea17fcbc21e16de2c3b0a6852c /spec/features/projects/files
parent91795dcd1c0d12d2350e0d00489d89be9fa29b32 (diff)
downloadgitlab-ce-21a8cc2c2a867f44ebe6df8377b0ebe391c2ebb2.tar.gz
Fix specs failing on duplicate gpg signature
It seems there are additional async requests related to gpg signature, w/o waiting for finishing all requests it fails on: Duplicate entry '...' for key 'index_gpg_signatures_on_commit_sha'
Diffstat (limited to 'spec/features/projects/files')
-rw-r--r--spec/features/projects/files/user_browses_files_spec.rb1
-rw-r--r--spec/features/projects/files/user_deletes_files_spec.rb4
-rw-r--r--spec/features/projects/files/user_edits_files_spec.rb20
-rw-r--r--spec/features/projects/files/user_replaces_files_spec.rb6
4 files changed, 20 insertions, 11 deletions
diff --git a/spec/features/projects/files/user_browses_files_spec.rb b/spec/features/projects/files/user_browses_files_spec.rb
index 612722eeaad..f3cf3a282e5 100644
--- a/spec/features/projects/files/user_browses_files_spec.rb
+++ b/spec/features/projects/files/user_browses_files_spec.rb
@@ -213,6 +213,7 @@ describe "User browses files" do
context "when browsing a file content", :js do
before do
visit(tree_path_root_ref)
+ wait_for_requests
click_link(".gitignore")
end
diff --git a/spec/features/projects/files/user_deletes_files_spec.rb b/spec/features/projects/files/user_deletes_files_spec.rb
index 5d37877ccb3..dcb7b947c61 100644
--- a/spec/features/projects/files/user_deletes_files_spec.rb
+++ b/spec/features/projects/files/user_deletes_files_spec.rb
@@ -19,6 +19,7 @@ describe 'Projects > Files > User deletes files', :js do
before do
project.add_maintainer(user)
visit(project_tree_path_root_ref)
+ wait_for_requests
end
it 'deletes the file', :js do
@@ -35,10 +36,11 @@ describe 'Projects > Files > User deletes files', :js do
end
end
- context 'when an user does not have write access' do
+ context 'when an user does not have write access', :js do
before do
project2.add_reporter(user)
visit(project2_tree_path_root_ref)
+ wait_for_requests
end
it 'deletes the file in a forked project', :js do
diff --git a/spec/features/projects/files/user_edits_files_spec.rb b/spec/features/projects/files/user_edits_files_spec.rb
index 072dc5820c4..9eb65ec159c 100644
--- a/spec/features/projects/files/user_edits_files_spec.rb
+++ b/spec/features/projects/files/user_edits_files_spec.rb
@@ -29,13 +29,14 @@ describe 'Projects > Files > User edits files', :js do
end
end
- context 'when an user has write access' do
+ context 'when an user has write access', :js do
before do
project.add_maintainer(user)
visit(project_tree_path_root_ref)
+ wait_for_requests
end
- it 'inserts a content of a file', :js do
+ it 'inserts a content of a file' do
click_link('.gitignore')
find('.js-edit-blob').click
find('.file-editor', match: :first)
@@ -49,13 +50,14 @@ describe 'Projects > Files > User edits files', :js do
it 'does not show the edit link if a file is binary' do
binary_file = File.join(project.repository.root_ref, 'files/images/logo-black.png')
visit(project_blob_path(project, binary_file))
+ wait_for_requests
page.within '.content' do
expect(page).not_to have_link('edit')
end
end
- it 'commits an edited file', :js do
+ it 'commits an edited file' do
click_link('.gitignore')
find('.js-edit-blob').click
find('.file-editor', match: :first)
@@ -72,7 +74,7 @@ describe 'Projects > Files > User edits files', :js do
expect(page).to have_content('*.rbca')
end
- it 'commits an edited file to a new branch', :js do
+ it 'commits an edited file to a new branch' do
click_link('.gitignore')
find('.js-edit-blob').click
@@ -91,7 +93,7 @@ describe 'Projects > Files > User edits files', :js do
expect(page).to have_content('*.rbca')
end
- it 'shows the diff of an edited file', :js do
+ it 'shows the diff of an edited file' do
click_link('.gitignore')
find('.js-edit-blob').click
find('.file-editor', match: :first)
@@ -106,13 +108,14 @@ describe 'Projects > Files > User edits files', :js do
it_behaves_like 'unavailable for an archived project'
end
- context 'when an user does not have write access' do
+ context 'when an user does not have write access', :js do
before do
project2.add_reporter(user)
visit(project2_tree_path_root_ref)
+ wait_for_requests
end
- it 'inserts a content of a file in a forked project', :js do
+ it 'inserts a content of a file in a forked project' do
click_link('.gitignore')
find('.js-edit-blob').click
@@ -134,7 +137,7 @@ describe 'Projects > Files > User edits files', :js do
expect(evaluate_script('ace.edit("editor").getValue()')).to eq('*.rbca')
end
- it 'commits an edited file in a forked project', :js do
+ it 'commits an edited file in a forked project' do
click_link('.gitignore')
find('.js-edit-blob').click
@@ -163,6 +166,7 @@ describe 'Projects > Files > User edits files', :js do
let!(:forked_project) { fork_project(project2, user, namespace: user.namespace, repository: true) }
before do
visit(project2_tree_path_root_ref)
+ wait_for_requests
end
it 'links to the forked project for editing' do
diff --git a/spec/features/projects/files/user_replaces_files_spec.rb b/spec/features/projects/files/user_replaces_files_spec.rb
index 3f973338305..e3da28d73c3 100644
--- a/spec/features/projects/files/user_replaces_files_spec.rb
+++ b/spec/features/projects/files/user_replaces_files_spec.rb
@@ -21,9 +21,10 @@ describe 'Projects > Files > User replaces files', :js do
before do
project.add_maintainer(user)
visit(project_tree_path_root_ref)
+ wait_for_requests
end
- it 'replaces an existed file with a new one', :js do
+ it 'replaces an existed file with a new one' do
click_link('.gitignore')
expect(page).to have_content('.gitignore')
@@ -47,9 +48,10 @@ describe 'Projects > Files > User replaces files', :js do
before do
project2.add_reporter(user)
visit(project2_tree_path_root_ref)
+ wait_for_requests
end
- it 'replaces an existed file with a new one in a forked project', :js do
+ it 'replaces an existed file with a new one in a forked project' do
click_link('.gitignore')
expect(page).to have_content('.gitignore')