Merge pull request #6804 from betagouv/fix-invisible-captcha-flash
Correction d'une erreur dans le formulaire de contact
This commit is contained in:
commit
e4755c5433
2 changed files with 14 additions and 4 deletions
|
@ -8,12 +8,15 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def flash_class(level, sticky: false, fixed: false)
|
||||
class_names = case level
|
||||
class_names = []
|
||||
|
||||
case level
|
||||
when 'notice'
|
||||
['alert-success']
|
||||
when 'alert'
|
||||
['alert-danger']
|
||||
class_names << 'alert-success'
|
||||
when 'alert', 'error'
|
||||
class_names << 'alert-danger'
|
||||
end
|
||||
|
||||
if sticky
|
||||
class_names << 'sticky'
|
||||
end
|
||||
|
|
|
@ -18,6 +18,13 @@ describe ApplicationHelper do
|
|||
end
|
||||
end
|
||||
|
||||
describe "#flash_class" do
|
||||
it { expect(flash_class('notice')).to eq 'alert-success' }
|
||||
it { expect(flash_class('alert', sticky: true, fixed: true)).to eq 'alert-danger sticky alert-fixed' }
|
||||
it { expect(flash_class('error')).to eq 'alert-danger' }
|
||||
it { expect(flash_class('unknown-level')).to eq '' }
|
||||
end
|
||||
|
||||
describe "#try_format_date" do
|
||||
subject { try_format_date(date) }
|
||||
|
||||
|
|
Loading…
Reference in a new issue