diff options
Diffstat (limited to 'spec/features/merge_requests')
-rw-r--r-- | spec/features/merge_requests/user_exports_as_csv_spec.rb | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/spec/features/merge_requests/user_exports_as_csv_spec.rb b/spec/features/merge_requests/user_exports_as_csv_spec.rb index 63ed1cb5231..a86ff9d7335 100644 --- a/spec/features/merge_requests/user_exports_as_csv_spec.rb +++ b/spec/features/merge_requests/user_exports_as_csv_spec.rb @@ -9,38 +9,23 @@ RSpec.describe 'Merge Requests > Exports as CSV', :js do before do sign_in(user) + visit(project_merge_requests_path(project)) end subject { page.find('.nav-controls') } - context 'feature is not enabled' do - before do - stub_feature_flags(export_merge_requests_as_csv: false) - visit(project_merge_requests_path(project)) - end - - it { is_expected.not_to have_button('Export as CSV') } - end + it { is_expected.to have_button('Export as CSV') } - context 'feature is enabled for a project' do + context 'button is clicked' do before do - stub_feature_flags(export_merge_requests_as_csv: project) - visit(project_merge_requests_path(project)) + click_button('Export as CSV') end - it { is_expected.to have_button('Export as CSV') } - - context 'button is clicked' do - before do - click_button('Export as CSV') - end - - it 'shows a success message' do - click_link('Export merge requests') + it 'shows a success message' do + click_link('Export merge requests') - expect(page).to have_content 'Your CSV export has started.' - expect(page).to have_content "It will be emailed to #{user.email} when complete" - end + expect(page).to have_content 'Your CSV export has started.' + expect(page).to have_content "It will be emailed to #{user.email} when complete" end end end |