diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-02-20 13:51:47 +0000 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-02-22 10:19:42 +0000 |
commit | 173e27d62a2fa880fa438ef6f07847bbd3e06fea (patch) | |
tree | 1c1dfca5adfc632eb2ed582bcb0fa5771b948332 /spec/features/groups_spec.rb | |
parent | 479cdc2cac78241109d2cb9d8cfd22d36319d367 (diff) | |
download | gitlab-ce-173e27d62a2fa880fa438ef6f07847bbd3e06fea.tar.gz |
Finished up mattermost team creationzj-create-mattermost-team-lb
Diffstat (limited to 'spec/features/groups_spec.rb')
-rw-r--r-- | spec/features/groups_spec.rb | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/features/groups_spec.rb b/spec/features/groups_spec.rb index 37b7c20239f..b4bd1925822 100644 --- a/spec/features/groups_spec.rb +++ b/spec/features/groups_spec.rb @@ -43,6 +43,43 @@ feature 'Group', feature: true do expect(page).to have_namespace_error_message end end + + describe 'Mattermost team creation' do + before do + Settings.mattermost['enabled'] = mattermost_enabled + visit new_group_path + end + + context 'Mattermost enabled' do + let(:mattermost_enabled) { true } + + it 'displays a team creation checkbox' do + expect(page).to have_selector('#group_create_chat_team') + end + + it 'checks the checkbox by default' do + expect(find('#group_create_chat_team')['checked']).to eq(true) + end + + it 'updates the team URL on graph path update', :js do + out_span = find('span[data-bind-out="create_chat_team"]') + + expect(out_span.text).to be_empty + + fill_in('group_path', with: 'test-group') + + expect(out_span.text).to eq('test-group') + end + end + + context 'Mattermost disabled' do + let(:mattermost_enabled) { false } + + it 'doesnt show a team creation checkbox if Mattermost not enabled' do + expect(page).not_to have_selector('#group_create_chat_team') + end + end + end end describe 'create a nested group' do |