blob: 885cfa0f595adc45ea323bd0fc9eef7bcf37bf80 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Group Export', :js, feature_category: :importers do
include ExportFileHelper
let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group) }
context 'when the signed in user has the required permission level' do
before do
group.add_owner(user)
sign_in(user)
end
it 'allows the user to export the group', :sidekiq_inline do
visit edit_group_path(group)
expect(page).to have_content('Export group')
click_link('Export group')
expect(page).to have_content('Group export started')
expect(page).to have_content('Download export')
end
end
context 'when the signed in user does not have the required permission level' do
before do
group.add_guest(user)
sign_in(user)
end
it 'does not let the user export the group' do
visit edit_group_path(group)
expect(page).to have_content('Page Not Found')
expect(page).not_to have_content('Export group')
end
end
end
|