diff options
Diffstat (limited to 'spec/features/groups_spec.rb')
-rw-r--r-- | spec/features/groups_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/features/groups_spec.rb b/spec/features/groups_spec.rb index 78a35fe1d3f..8104ff3f987 100644 --- a/spec/features/groups_spec.rb +++ b/spec/features/groups_spec.rb @@ -68,6 +68,35 @@ RSpec.describe 'Group' do end end + describe 'real-time group url validation', :js do + it 'shows a message if group url is available' do + fill_in 'group_path', with: 'az' + wait_for_requests + + expect(page).to have_content('Group path is available') + end + + it 'shows an error if group url is taken' do + fill_in 'group_path', with: user.username + wait_for_requests + + expect(page).to have_content('Group path is already taken') + end + + it 'does not break after an invalid form submit' do + fill_in 'group_name', with: 'MyGroup' + fill_in 'group_path', with: 'z' + click_button 'Create group' + + expect(page).to have_content('Group URL is too short') + + fill_in 'group_path', with: 'az' + wait_for_requests + + expect(page).to have_content('Group path is available') + end + end + describe 'Mattermost team creation' do before do stub_mattermost_setting(enabled: mattermost_enabled) |