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
|
end
|
||||||
|
|
||||||
def flash_class(level, sticky: false, fixed: false)
|
def flash_class(level, sticky: false, fixed: false)
|
||||||
class_names = case level
|
class_names = []
|
||||||
|
|
||||||
|
case level
|
||||||
when 'notice'
|
when 'notice'
|
||||||
['alert-success']
|
class_names << 'alert-success'
|
||||||
when 'alert'
|
when 'alert', 'error'
|
||||||
['alert-danger']
|
class_names << 'alert-danger'
|
||||||
end
|
end
|
||||||
|
|
||||||
if sticky
|
if sticky
|
||||||
class_names << 'sticky'
|
class_names << 'sticky'
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,6 +18,13 @@ describe ApplicationHelper do
|
||||||
end
|
end
|
||||||
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
|
describe "#try_format_date" do
|
||||||
subject { try_format_date(date) }
|
subject { try_format_date(date) }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue