diff options
author | Clement Ho <clemmakesapps@gmail.com> | 2017-02-07 18:16:20 +0000 |
---|---|---|
committer | Clement Ho <clemmakesapps@gmail.com> | 2017-02-07 18:16:20 +0000 |
commit | 18be86c97e9749b2c1fbc576b52f81d9d3d28938 (patch) | |
tree | 241cc57f320895a0ff9fc60603352a479984d29a /spec | |
parent | e15cb9e3a72ad5ccdbb58d28a66a16d0a7185b7b (diff) | |
parent | 78709bb938579710aa169d9fd7fb6c614d5afad4 (diff) | |
download | gitlab-ce-18be86c97e9749b2c1fbc576b52f81d9d3d28938.tar.gz |
Merge branch '25487-small-improvements-to-the-ui-of-mattermost-and-slack-command-services' into 'master'
Resolve "Small improvements to the UI of Mattermost and Slack Command services"
Closes #25487
See merge request !8491
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/projects/services/mattermost_slash_command_spec.rb | 22 | ||||
-rw-r--r-- | spec/features/projects/services/slack_slash_command_spec.rb | 21 |
2 files changed, 24 insertions, 19 deletions
diff --git a/spec/features/projects/services/mattermost_slash_command_spec.rb b/spec/features/projects/services/mattermost_slash_command_spec.rb index 042a1ccab51..f5adb53a2dc 100644 --- a/spec/features/projects/services/mattermost_slash_command_spec.rb +++ b/spec/features/projects/services/mattermost_slash_command_spec.rb @@ -1,8 +1,6 @@ require 'spec_helper' feature 'Setup Mattermost slash commands', feature: true do - include WaitForAjax - let(:user) { create(:user) } let(:project) { create(:empty_project) } let(:service) { project.create_mattermost_slash_commands_service } @@ -15,11 +13,15 @@ feature 'Setup Mattermost slash commands', feature: true do visit edit_namespace_project_service_path(project.namespace, project, service) end - describe 'user visits the mattermost slash command config page', js: true do + describe 'user visits the mattermost slash command config page' do it 'shows a help message' do - wait_for_ajax + expect(page).to have_content("This service allows users to perform common") + end + + it 'shows a token placeholder' do + token_placeholder = find_field('service_token')['placeholder'] - expect(page).to have_content("This service allows GitLab users to perform common") + expect(token_placeholder).to eq('XXxxXXxxXXxxXXxxXXxxXXxx') end it 'shows the token after saving' do @@ -64,7 +66,7 @@ feature 'Setup Mattermost slash commands', feature: true do select_element = find('select#mattermost_team_id') selected_option = select_element.find('option[selected]') - expect(select_element['disabled']).to be(true) + expect(select_element['disabled']).to eq('disabled') expect(selected_option).to have_content(team_name.to_s) end @@ -93,7 +95,7 @@ feature 'Setup Mattermost slash commands', feature: true do select_element = find('select#mattermost_team_id') selected_option = select_element.find('option[selected]') - expect(select_element['disabled']).to be(false) + expect(select_element['disabled']).to be(nil) expect(selected_option).to have_content('Select team...') # The 'Select team...' placeholder is item `0`. expect(select_element.all('option').count).to eq(3) @@ -135,6 +137,12 @@ feature 'Setup Mattermost slash commands', feature: true do expect(value).to match("api/v3/projects/#{project.id}/services/mattermost_slash_commands/trigger") end + + it 'shows a token placeholder' do + token_placeholder = find_field('service_token')['placeholder'] + + expect(token_placeholder).to eq('XXxxXXxxXXxxXXxxXXxxXXxx') + end end end diff --git a/spec/features/projects/services/slack_slash_command_spec.rb b/spec/features/projects/services/slack_slash_command_spec.rb index 32b32f7ae8e..db903a0c8f0 100644 --- a/spec/features/projects/services/slack_slash_command_spec.rb +++ b/spec/features/projects/services/slack_slash_command_spec.rb @@ -1,8 +1,6 @@ require 'spec_helper' feature 'Slack slash commands', feature: true do - include WaitForAjax - given(:user) { create(:user) } given(:project) { create(:project) } given(:service) { project.create_slack_slash_commands_service } @@ -10,19 +8,20 @@ feature 'Slack slash commands', feature: true do background do project.team << [user, :master] login_as(user) - end - - scenario 'user visits the slack slash command config page and shows a help message', js: true do visit edit_namespace_project_service_path(project.namespace, project, service) + end - wait_for_ajax + it 'shows a token placeholder' do + token_placeholder = find_field('service_token')['placeholder'] - expect(page).to have_content('This service allows GitLab users to perform common') + expect(token_placeholder).to eq('XXxxXXxxXXxxXXxxXXxxXXxx') end - scenario 'shows the token after saving' do - visit edit_namespace_project_service_path(project.namespace, project, service) + it 'shows a help message' do + expect(page).to have_content('This service allows users to perform common') + end + it 'shows the token after saving' do fill_in 'service_token', with: 'token' click_on 'Save' @@ -31,9 +30,7 @@ feature 'Slack slash commands', feature: true do expect(value).to eq('token') end - scenario 'shows the correct trigger url' do - visit edit_namespace_project_service_path(project.namespace, project, service) - + it 'shows the correct trigger url' do value = find_field('url').value expect(value).to match("api/v3/projects/#{project.id}/services/slack_slash_commands/trigger") end |