Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.

Commit

Permalink
Rename pwdcalc_i18n_hints => pwdcalc_translated_hints
Browse files Browse the repository at this point in the history
  • Loading branch information
trimentor committed Dec 31, 2015
1 parent eb68750 commit 331ccab
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Use *Pwdcalc::FormBuilder* to automatically create password field/-strength mete

Add the following line somewhere inside your view (e.g. at the bottom of your form):

<%= pwdcalc_i18n_hints %>
<%= pwdcalc_translated_hints %>

=== Dictionary Attacks

Expand Down
2 changes: 1 addition & 1 deletion lib/pwdcalc/helpers/form_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def pwdcalc_password_help_block
content_tag(:div, "", :class => 'pwdcalc-help-block')
end

def pwdcalc_i18n_hints
def pwdcalc_translated_hints
content_tag(:div, :class => 'pwdcalc-hints') do
safe_join Pwdcalc::Helpers::Hints.translate_hints.map.with_index { |hint, index|
content_tag(:div, hint, :class => 'pwdcalc-hint', :data => {:complexity => Pwdcalc::Helpers::Hints::STRENGTH_TYPES[index].to_s.gsub(/_/, '-')})
Expand Down
14 changes: 7 additions & 7 deletions spec/lib/pwdcalc/helpers/form_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
end
end

describe '#pwdcalc_i18n_hints' do
describe '#pwdcalc_translated_hints' do
it 'returns HTML content' do
expect(helper.pwdcalc_i18n_hints).to match('<div class="pwdcalc-hint" data-complexity="weak">Password is very weak.</div>')
expect(helper.pwdcalc_i18n_hints).to match('<div class="pwdcalc-hint" data-complexity="fair">Password could be more secure.</div>')
expect(helper.pwdcalc_i18n_hints).to match('<div class="pwdcalc-hint" data-complexity="good">Password is okay.</div>')
expect(helper.pwdcalc_i18n_hints).to match('<div class="pwdcalc-hint" data-complexity="strong">Password is strong.</div>')
expect(helper.pwdcalc_i18n_hints).to match('<div class="pwdcalc-hint" data-complexity="very-strong">Password is perfect!</div>')
expect(helper.pwdcalc_i18n_hints).to match('<div class="pwdcalc-hint" data-complexity="dictionary-word">Password is too obvious.</div>')
expect(helper.pwdcalc_translated_hints).to match('<div class="pwdcalc-hint" data-complexity="weak">Password is very weak.</div>')
expect(helper.pwdcalc_translated_hints).to match('<div class="pwdcalc-hint" data-complexity="fair">Password could be more secure.</div>')
expect(helper.pwdcalc_translated_hints).to match('<div class="pwdcalc-hint" data-complexity="good">Password is okay.</div>')
expect(helper.pwdcalc_translated_hints).to match('<div class="pwdcalc-hint" data-complexity="strong">Password is strong.</div>')
expect(helper.pwdcalc_translated_hints).to match('<div class="pwdcalc-hint" data-complexity="very-strong">Password is perfect!</div>')
expect(helper.pwdcalc_translated_hints).to match('<div class="pwdcalc-hint" data-complexity="dictionary-word">Password is too obvious.</div>')
end
end

Expand Down

0 comments on commit 331ccab

Please sign in to comment.