diff options
Diffstat (limited to 'spec/features/projects/show/user_uploads_files_spec.rb')
-rw-r--r-- | spec/features/projects/show/user_uploads_files_spec.rb | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/spec/features/projects/show/user_uploads_files_spec.rb b/spec/features/projects/show/user_uploads_files_spec.rb index b7c5d324d93..2030c4d998a 100644 --- a/spec/features/projects/show/user_uploads_files_spec.rb +++ b/spec/features/projects/show/user_uploads_files_spec.rb @@ -34,33 +34,23 @@ RSpec.describe 'Projects > Show > User uploads files' do include_examples 'it uploads and commit a new file to a forked project' end - context 'with an empty repo' do - let(:project) { create(:project, :empty_repo, creator: user) } - - context 'when in the empty_repo_upload experiment' do - before do - stub_experiments(empty_repo_upload: :candidate) - - visit(project_path(project)) - end - - it 'uploads and commits a new text file', :js do - click_link('Upload file') + context 'when in the empty_repo_upload experiment' do + before do + stub_experiments(empty_repo_upload: :candidate) - drop_in_dropzone(File.join(Rails.root, 'spec', 'fixtures', 'doc_sample.txt')) + visit(project_path(project)) + end - page.within('#modal-upload-blob') do - fill_in(:commit_message, with: 'New commit message') - end + context 'with an empty repo' do + let(:project) { create(:project, :empty_repo, creator: user) } - click_button('Upload file') + include_examples 'uploads and commits a new text file via "upload file" button' + end - wait_for_requests + context 'with a nonempty repo' do + let(:project) { create(:project, :repository, creator: user) } - expect(page).to have_content('New commit message') - expect(page).to have_content('Lorem ipsum dolor sit amet') - expect(page).to have_content('Sed ut perspiciatis unde omnis') - end + include_examples 'uploads and commits a new text file via "upload file" button' end end end |