context'when there is an not yet billed user in the additional group'do
it'triggers overage modal'do
add_group_with_one_extra_user
click_button'Continue'
wait_for_requests
page.refresh
click_groups_tab
page.within(first_row)do
expect(page).tohave_content(group_to_add.name)
expect(page).tohave_content('Reporter')
end
end
end
context'when overage modal is shown'do
it'goes back to the initial modal if not confirmed'do
add_group_with_one_extra_user
click_button'Back'
expect(page).tohave_content("You're inviting a group to the #{group.name} group.")
click_button'Cancel'
expect(page).not_tohave_link'Groups'
end
end
end
defadd_group(name,role: 'Guest',expires_at: nil)
click_on'Invite a group'
click_on'Select a group'
wait_for_requests
click_buttonname
choose_options(role,expires_at)
click_button'Invite'
end
defadd_group_with_one_extra_user
group.add_owner(user)
group_to_add.add_owner(user)
group_to_add.add_developer(user2)
visitgroup_group_members_path(group)
add_group(group_to_add.name,role: 'Reporter')
wait_for_requests
expect(page).tohave_content("Your subscription includes 1 seat. If you continue, the #{group.name} group will have 2 seats in use and will be billed for the overage. Learn more.")