Skip to content

Commit

Permalink
Enure that I18n's aren't humanized
Browse files Browse the repository at this point in the history
> I have / had a passing interest in not having these just be humanized versions
> of the translations, but that doesn't really matter anymore since we have a
> lot of those.

-- @calebthompson
  • Loading branch information
seanpdoyle committed Sep 19, 2014
1 parent ebff5cc commit 420be84
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
4 changes: 2 additions & 2 deletions spec/features/fill_in_user_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
expect { form.fill }
.to raise_error(
Formulaic::InputNotFound,
'Unable to find checkboxes or select[multiple] "Likes" containing all options ["Ruby", "Perl"].'
'Unable to find checkboxes or select[multiple] "Your Likes" containing all options ["Ruby", "Perl"].'
)
end

Expand All @@ -126,7 +126,7 @@
expect { form.fill }
.to raise_error(
Formulaic::InputNotFound,
'Unable to find checkboxes or select[multiple] "Dislikes" containing all options ["Java", "Go"].'
'Unable to find checkboxes or select[multiple] "Your Dislikes" containing all options ["Java", "Go"].'
)
end

Expand Down
25 changes: 16 additions & 9 deletions spec/fixtures/user_form.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<form accept-charset="UTF-8" action="/users" class="simple_form new_user" id="new_user" method="post" novalidate="novalidate">
<div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value=""><input name="authenticity_token" type="hidden" value="O6ORla31JvEaWroCuiA7bArM15ztDotMfPAbNW0v61g="></div>
<div class="input string required user_name"><label class="string required" for="user_name"><abbr title="required">*</abbr> Display name</label><input class="string required" id="user_name" maxlength="255" name="user[name]" size="50" type="text"></div>
<div class="input email required user_email"><label class="email required" for="user_email"><abbr title="required">*</abbr> Email</label><input class="string email required" id="user_email" maxlength="255" name="user[email]" size="50" type="email"></div>
<div class="input string required user_name"><label class="string required"
for="user_name"><abbr title="required">*</abbr> Your Display name</label><input class="string required" id="user_name" maxlength="255" name="user[name]" size="50" type="text"></div>
<div class="input email required user_email"><label class="email required"
for="user_email"><abbr title="required">*</abbr> Your Email</label><input class="string email required" id="user_email" maxlength="255" name="user[email]" size="50" type="email"></div>
<div class="input tel required user_phone"><label class="tel required" for="user_phone"><abbr title="required">*</abbr> Phone Number</label><input class="string phone required" id="user_phone" maxlength="255" name="user[phone]" size="50" type="tel"></div>
<div class="input integer required user_age"><label class="integer required" for="user_age"><abbr title="required">*</abbr> Age</label><input class="numeric integer age required" id="user_age" maxlength="255" name="user[age]" size="50" type="number"></div>
<div class="input integer required user_age"><label class="integer required"
for="user_age"><abbr title="required">*</abbr> Your Age</label><input class="numeric integer age required" id="user_age" maxlength="255" name="user[age]" size="50" type="number"></div>
<div class="input url required user_url"><label class="tel required" for="user_url"><abbr title="required">*</abbr> Website</label><input class="string url required" id="user_url" maxlength="255" name="user[url]" size="50" type="url"></div>
<div class="input file optional user_avatar"><label class="file optional" for="user_avatar">Avatar</label><input class="file optional" id="user_avatar" name="user[avatar]" type="file" /></div>
<div class="input password optional user_password"><label class="password optional" for="user_password">Password</label><input class="password optional" id="user_password" name="user[password]" size="50" type="password"></div>
<div class="input file optional user_avatar"><label class="file optional"
for="user_avatar">Your Avatar</label><input class="file optional" id="user_avatar" name="user[avatar]" type="file" /></div>
<div class="input password optional user_password"><label class="password
optional" for="user_password">Your Password</label><input class="password optional" id="user_password" name="user[password]" size="50" type="password"></div>
<div class="input select required user_awesome">
<label class="select required" for="user_awesome"><abbr title="required">*</abbr> Are you awesome?</label>
<select class="select required" id="user_awesome" name="user[awesome]">
Expand All @@ -16,7 +21,7 @@
</select>
</div>
<div class="input select user_likes">
<label class="select" for="user_likes">Likes</label>
<label class="select" for="user_likes">Your Likes</label>
<select class="select" id="user_likes" name="user[likes][]" multiple>
<option value=""></option>
<option value="ruby">Ruby</option>
Expand All @@ -25,7 +30,7 @@
</select>
</div>
<div class="input check_boxes optional user_dislikes">
<label class="check_boxes optional">Dislikes</label>
<label class="check_boxes optional">Your Dislikes</label>
<span class="checkbox">
<input class="check_boxes optional" id="user_dislikes_1" name="user[dislikes][]" type="checkbox" value="java">
<label class="collection_check_boxes" for="user_dislikes_1">Java</label>
Expand All @@ -38,9 +43,11 @@
</span>
<input name="user[dislikes][]" type="hidden" value="">
</div>
<div class="input text required user_bio"><label class="text required" for="user_bio"><abbr title="required">*</abbr> Biography</label><textarea class="text required" cols="40" id="user_bio" name="user[bio]" rows="20" style="overflow: hidden; word-wrap: break-word; resize: horizontal; height: 464px;"></textarea></div>
<div class="input text required user_bio"><label class="text required"
for="user_bio"><abbr title="required">*</abbr> Your Biography</label><textarea class="text required" cols="40" id="user_bio" name="user[bio]" rows="20" style="overflow: hidden; word-wrap: break-word; resize: horizontal; height: 464px;"></textarea></div>
<div class="input date required user_date_of_birth">
<label class="date required" for="user_date_of_birth_1i"><abbr title="required">*</abbr> Date of birth</label>
<label class="date required" for="user_date_of_birth_1i"><abbr
title="required">*</abbr> Your Date of birth</label>
<select class="date required" id="user_date_of_birth_1i" name="user[date_of_birth(1i)]">
<option value="2001">2001</option>
<option value="2000">2000</option>
Expand Down
16 changes: 8 additions & 8 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ def load_translations
simple_form:
labels:
user:
age: Age
avatar: Avatar
age: Your Age
avatar: Your Avatar
awesome: Are you awesome?
bio: Biography
date_of_birth: Date of birth
likes: Likes
dislikes: Dislikes
email: Email
name: Display name
date_of_birth: Your Date of birth
likes: Your Likes
dislikes: Your Dislikes
email: Your Email
name: Your Display name
new:
password: Password
password: Your Password
phone: Phone Number
terms_of_service: I agree to the Terms of Service
url: Website
Expand Down

0 comments on commit 420be84

Please sign in to comment.