diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-27 12:10:16 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-27 12:10:16 +0000 |
commit | af3904f9d0c9abab61f96f63d0c889f54e31fabd (patch) | |
tree | 3e37e9766bf290c0e65aa7c9628f0ec247427f26 /spec/views | |
parent | 1b9f574b89cb80cdd5af8cba3ad3e7995a4af47d (diff) | |
download | gitlab-ce-af3904f9d0c9abab61f96f63d0c889f54e31fabd.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/views')
-rw-r--r-- | spec/views/admin/broadcast_messages/index.html.haml_spec.rb | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/spec/views/admin/broadcast_messages/index.html.haml_spec.rb b/spec/views/admin/broadcast_messages/index.html.haml_spec.rb index e1dc76428df..ba998085bf9 100644 --- a/spec/views/admin/broadcast_messages/index.html.haml_spec.rb +++ b/spec/views/admin/broadcast_messages/index.html.haml_spec.rb @@ -3,20 +3,22 @@ require 'spec_helper' RSpec.describe 'admin/broadcast_messages/index' do - describe 'Target roles select and table column' do - let(:feature_flag_state) { true } + let(:role_targeted_broadcast_messages) { true } + let(:vue_broadcast_messages) { false } - let_it_be(:message) { create(:broadcast_message, broadcast_type: 'banner', target_access_levels: [Gitlab::Access::GUEST, Gitlab::Access::DEVELOPER]) } + let_it_be(:message) { create(:broadcast_message, broadcast_type: 'banner', target_access_levels: [Gitlab::Access::GUEST, Gitlab::Access::DEVELOPER]) } - before do - assign(:broadcast_messages, BroadcastMessage.page(1)) - assign(:broadcast_message, BroadcastMessage.new) + before do + assign(:broadcast_messages, BroadcastMessage.page(1)) + assign(:broadcast_message, BroadcastMessage.new) - stub_feature_flags(role_targeted_broadcast_messages: feature_flag_state) + stub_feature_flags(role_targeted_broadcast_messages: role_targeted_broadcast_messages) + stub_feature_flags(vue_broadcast_messages: vue_broadcast_messages) - render - end + render + end + describe 'Target roles select and table column' do it 'rendered' do expect(rendered).to have_content('Target roles') expect(rendered).to have_content('Owner') @@ -24,7 +26,7 @@ RSpec.describe 'admin/broadcast_messages/index' do end context 'when feature flag is off' do - let(:feature_flag_state) { false } + let(:role_targeted_broadcast_messages) { false } it 'is not rendered' do expect(rendered).not_to have_content('Target roles') @@ -33,4 +35,18 @@ RSpec.describe 'admin/broadcast_messages/index' do end end end + + describe 'Vue application' do + it 'is not rendered' do + expect(rendered).not_to have_selector('#js-broadcast-messages') + end + + context 'when feature flag is on' do + let(:vue_broadcast_messages) { true } + + it 'is rendered' do + expect(rendered).to have_selector('#js-broadcast-messages') + end + end + end end |