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:
Diffstat (limited to 'spec/views/layouts/_flash.html.haml_spec.rb')
-rw-r--r--spec/views/layouts/_flash.html.haml_spec.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/spec/views/layouts/_flash.html.haml_spec.rb b/spec/views/layouts/_flash.html.haml_spec.rb
index 82c06feb4fb..a4bed09368f 100644
--- a/spec/views/layouts/_flash.html.haml_spec.rb
+++ b/spec/views/layouts/_flash.html.haml_spec.rb
@@ -9,7 +9,11 @@ RSpec.describe 'layouts/_flash' do
end
describe 'closable flash messages' do
- %w(alert notice success).each do |flash_type|
+ where(:flash_type) do
+ %w[alert notice success]
+ end
+
+ with_them do
let(:flash) { { flash_type => 'This is a closable flash message' } }
it 'shows a close button' do
@@ -19,10 +23,14 @@ RSpec.describe 'layouts/_flash' do
end
describe 'non closable flash messages' do
- %w(error message toast warning).each do |flash_type|
+ where(:flash_type) do
+ %w[error message toast warning]
+ end
+
+ with_them do
let(:flash) { { flash_type => 'This is a non closable flash message' } }
- it 'shows a close button' do
+ it 'does not show a close button' do
expect(rendered).not_to include('js-close-icon')
end
end