diff options
Diffstat (limited to 'spec/views/admin/broadcast_messages/index.html.haml_spec.rb')
-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 |