blob: 4c37d6b47604385aa0c43d78e98507c46d8c4361 (
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
44
45
46
47
48
49
50
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'new navigation toggle', :js, feature_category: :navigation do
include Features::InviteMembersModalHelpers
let_it_be(:user) { create(:user, use_new_navigation: true) }
before do
sign_in(user)
end
context 'when inside a group' do
let_it_be(:group) { create(:group).tap { |record| record.add_owner(user) } }
before do
visit group_path(group)
end
it 'the add menu contains invite members dropdown option and opens invite modal' do
invite_members_from_menu
page.within invite_modal_selector do
expect(page).to have_content("You're inviting members to the #{group.name} group")
end
end
end
context 'when inside a project' do
let_it_be(:project) { create(:project, :repository).tap { |record| record.add_owner(user) } }
before do
visit project_path(project)
end
it 'the add menu contains invite members dropdown option and opens invite modal' do
invite_members_from_menu
page.within invite_modal_selector do
expect(page).to have_content("You're inviting members to the #{project.name} project")
end
end
end
def invite_members_from_menu
page.find('[data-testid="new-menu-toggle"] button').click
click_button('Invite team members')
end
end
|