Commit 21a8cc2c authored by Jan Provaznik's avatar Jan Provaznik

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'
parent 91795dcd
...@@ -18,6 +18,7 @@ describe 'Blob shortcuts', :js do ...@@ -18,6 +18,7 @@ describe 'Blob shortcuts', :js do
describe 'pressing "y"' do describe 'pressing "y"' do
it 'redirects to permalink with commit sha' do it 'redirects to permalink with commit sha' do
visit_blob visit_blob
wait_for_requests
find('body').native.send_key('y') find('body').native.send_key('y')
...@@ -27,6 +28,7 @@ describe 'Blob shortcuts', :js do ...@@ -27,6 +28,7 @@ describe 'Blob shortcuts', :js do
it 'maintains fragment hash when redirecting' do it 'maintains fragment hash when redirecting' do
fragment = "L1" fragment = "L1"
visit_blob(fragment) visit_blob(fragment)
wait_for_requests
find('body').native.send_key('y') find('body').native.send_key('y')
......
...@@ -213,6 +213,7 @@ describe "User browses files" do ...@@ -213,6 +213,7 @@ describe "User browses files" do
context "when browsing a file content", :js do context "when browsing a file content", :js do
before do before do
visit(tree_path_root_ref) visit(tree_path_root_ref)
wait_for_requests
click_link(".gitignore") click_link(".gitignore")
end end
......
...@@ -19,6 +19,7 @@ describe 'Projects > Files > User deletes files', :js do ...@@ -19,6 +19,7 @@ describe 'Projects > Files > User deletes files', :js do
before do before do
project.add_maintainer(user) project.add_maintainer(user)
visit(project_tree_path_root_ref) visit(project_tree_path_root_ref)
wait_for_requests
end end
it 'deletes the file', :js do it 'deletes the file', :js do
...@@ -35,10 +36,11 @@ describe 'Projects > Files > User deletes files', :js do ...@@ -35,10 +36,11 @@ describe 'Projects > Files > User deletes files', :js do
end end
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 before do
project2.add_reporter(user) project2.add_reporter(user)
visit(project2_tree_path_root_ref) visit(project2_tree_path_root_ref)
wait_for_requests
end end
it 'deletes the file in a forked project', :js do it 'deletes the file in a forked project', :js do
......
...@@ -29,13 +29,14 @@ describe 'Projects > Files > User edits files', :js do ...@@ -29,13 +29,14 @@ describe 'Projects > Files > User edits files', :js do
end end
end end
context 'when an user has write access' do context 'when an user has write access', :js do
before do before do
project.add_maintainer(user) project.add_maintainer(user)
visit(project_tree_path_root_ref) visit(project_tree_path_root_ref)
wait_for_requests
end end
it 'inserts a content of a file', :js do it 'inserts a content of a file' do
click_link('.gitignore') click_link('.gitignore')
find('.js-edit-blob').click find('.js-edit-blob').click
find('.file-editor', match: :first) find('.file-editor', match: :first)
...@@ -49,13 +50,14 @@ describe 'Projects > Files > User edits files', :js do ...@@ -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 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') binary_file = File.join(project.repository.root_ref, 'files/images/logo-black.png')
visit(project_blob_path(project, binary_file)) visit(project_blob_path(project, binary_file))
wait_for_requests
page.within '.content' do page.within '.content' do
expect(page).not_to have_link('edit') expect(page).not_to have_link('edit')
end end
end end
it 'commits an edited file', :js do it 'commits an edited file' do
click_link('.gitignore') click_link('.gitignore')
find('.js-edit-blob').click find('.js-edit-blob').click
find('.file-editor', match: :first) find('.file-editor', match: :first)
...@@ -72,7 +74,7 @@ describe 'Projects > Files > User edits files', :js do ...@@ -72,7 +74,7 @@ describe 'Projects > Files > User edits files', :js do
expect(page).to have_content('*.rbca') expect(page).to have_content('*.rbca')
end 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') click_link('.gitignore')
find('.js-edit-blob').click find('.js-edit-blob').click
...@@ -91,7 +93,7 @@ describe 'Projects > Files > User edits files', :js do ...@@ -91,7 +93,7 @@ describe 'Projects > Files > User edits files', :js do
expect(page).to have_content('*.rbca') expect(page).to have_content('*.rbca')
end end
it 'shows the diff of an edited file', :js do it 'shows the diff of an edited file' do
click_link('.gitignore') click_link('.gitignore')
find('.js-edit-blob').click find('.js-edit-blob').click
find('.file-editor', match: :first) find('.file-editor', match: :first)
...@@ -106,13 +108,14 @@ describe 'Projects > Files > User edits files', :js do ...@@ -106,13 +108,14 @@ describe 'Projects > Files > User edits files', :js do
it_behaves_like 'unavailable for an archived project' it_behaves_like 'unavailable for an archived project'
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 before do
project2.add_reporter(user) project2.add_reporter(user)
visit(project2_tree_path_root_ref) visit(project2_tree_path_root_ref)
wait_for_requests
end 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') click_link('.gitignore')
find('.js-edit-blob').click find('.js-edit-blob').click
...@@ -134,7 +137,7 @@ describe 'Projects > Files > User edits files', :js do ...@@ -134,7 +137,7 @@ describe 'Projects > Files > User edits files', :js do
expect(evaluate_script('ace.edit("editor").getValue()')).to eq('*.rbca') expect(evaluate_script('ace.edit("editor").getValue()')).to eq('*.rbca')
end 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') click_link('.gitignore')
find('.js-edit-blob').click find('.js-edit-blob').click
...@@ -163,6 +166,7 @@ describe 'Projects > Files > User edits files', :js do ...@@ -163,6 +166,7 @@ describe 'Projects > Files > User edits files', :js do
let!(:forked_project) { fork_project(project2, user, namespace: user.namespace, repository: true) } let!(:forked_project) { fork_project(project2, user, namespace: user.namespace, repository: true) }
before do before do
visit(project2_tree_path_root_ref) visit(project2_tree_path_root_ref)
wait_for_requests
end end
it 'links to the forked project for editing' do it 'links to the forked project for editing' do
......
...@@ -21,9 +21,10 @@ describe 'Projects > Files > User replaces files', :js do ...@@ -21,9 +21,10 @@ describe 'Projects > Files > User replaces files', :js do
before do before do
project.add_maintainer(user) project.add_maintainer(user)
visit(project_tree_path_root_ref) visit(project_tree_path_root_ref)
wait_for_requests
end 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') click_link('.gitignore')
expect(page).to have_content('.gitignore') expect(page).to have_content('.gitignore')
...@@ -47,9 +48,10 @@ describe 'Projects > Files > User replaces files', :js do ...@@ -47,9 +48,10 @@ describe 'Projects > Files > User replaces files', :js do
before do before do
project2.add_reporter(user) project2.add_reporter(user)
visit(project2_tree_path_root_ref) visit(project2_tree_path_root_ref)
wait_for_requests
end 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') click_link('.gitignore')
expect(page).to have_content('.gitignore') expect(page).to have_content('.gitignore')
......
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