Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-05 03:07:49 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-05 03:07:49 +0300
commit77237c5a6b9044f58beabc54d3589e5fa09cbfba (patch)
treef43188047fe8955f6cf78e05ae9c2e8f6a019e0b /spec/features/broadcast_messages_spec.rb
parent2fd92f2dc784ade9cb4e1c33dd60cbfad7b86818 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/broadcast_messages_spec.rb')
-rw-r--r--spec/features/broadcast_messages_spec.rb56
1 files changed, 43 insertions, 13 deletions
diff --git a/spec/features/broadcast_messages_spec.rb b/spec/features/broadcast_messages_spec.rb
index 43fbf1010c9..d7c84b8085b 100644
--- a/spec/features/broadcast_messages_spec.rb
+++ b/spec/features/broadcast_messages_spec.rb
@@ -3,28 +3,58 @@
require 'spec_helper'
describe 'Broadcast Messages' do
- let!(:broadcast_message) { create(:broadcast_message, broadcast_type: 'notification', message: 'SampleMessage') }
+ shared_examples 'a Broadcast Messages' do
+ it 'shows broadcast message' do
+ visit root_path
- it 'shows broadcast message' do
- visit root_path
+ expect(page).to have_content 'SampleMessage'
+ end
+ end
+
+ shared_examples 'a dismissable Broadcast Messages' do
+ it 'hides broadcast message after dismiss', :js do
+ visit root_path
+
+ find('.js-dismiss-current-broadcast-notification').click
+
+ expect(page).not_to have_content 'SampleMessage'
+ end
+
+ it 'broadcast message is still hidden after refresh', :js do
+ visit root_path
+
+ find('.js-dismiss-current-broadcast-notification').click
+ visit root_path
+
+ expect(page).not_to have_content 'SampleMessage'
+ end
+ end
+
+ describe 'banner type' do
+ let!(:broadcast_message) { create(:broadcast_message, message: 'SampleMessage') }
+
+ it_behaves_like 'a Broadcast Messages'
+
+ it 'shows broadcast message' do
+ visit root_path
- expect(page).to have_content 'SampleMessage'
+ expect(page).not_to have_selector('.js-dismiss-current-broadcast-notification')
+ end
end
- it 'hides broadcast message after dismiss', :js do
- visit root_path
+ describe 'dismissable banner type' do
+ let!(:broadcast_message) { create(:broadcast_message, dismissable: true, message: 'SampleMessage') }
- find('.js-dismiss-current-broadcast-notification').click
+ it_behaves_like 'a Broadcast Messages'
- expect(page).not_to have_content 'SampleMessage'
+ it_behaves_like 'a dismissable Broadcast Messages'
end
- it 'broadcast message is still hidden after refresh', :js do
- visit root_path
+ describe 'notification type' do
+ let!(:broadcast_message) { create(:broadcast_message, broadcast_type: 'notification', message: 'SampleMessage') }
- find('.js-dismiss-current-broadcast-notification').click
- visit root_path
+ it_behaves_like 'a Broadcast Messages'
- expect(page).not_to have_content 'SampleMessage'
+ it_behaves_like 'a dismissable Broadcast Messages'
end
end