diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-28 18:08:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-28 18:08:35 +0000 |
commit | 6315ed9630fb1c6ade3114beb762cd1568d79219 (patch) | |
tree | 2a5d31936d09c14420c8f4c8bd752e268f0eb19f /spec/features/broadcast_messages_spec.rb | |
parent | fedf978f9aa1909ed7bb3fad767ad120a1c6bd7b (diff) | |
download | gitlab-ce-6315ed9630fb1c6ade3114beb762cd1568d79219.tar.gz |
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.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/features/broadcast_messages_spec.rb b/spec/features/broadcast_messages_spec.rb new file mode 100644 index 00000000000..43fbf1010c9 --- /dev/null +++ b/spec/features/broadcast_messages_spec.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'Broadcast Messages' do + let!(:broadcast_message) { create(:broadcast_message, broadcast_type: 'notification', message: 'SampleMessage') } + + it 'shows broadcast message' do + visit root_path + + expect(page).to have_content 'SampleMessage' + end + + 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 |