Skip to content

Commit

Permalink
Refactored feature validations
Browse files Browse the repository at this point in the history
  • Loading branch information
baphled committed Aug 6, 2010
1 parent 7b62415 commit 6eff95d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/feature.rb
Expand Up @@ -13,7 +13,7 @@ class Feature < ActiveRecord::Base

validates_associated :stories, :on => :create

validates_length_of :title, :minimum => 6, :too_short => :too_short
validates_length_of :title, :minimum => 4, :too_short => :too_short
validates_length_of :in_order, :minimum => 7, :too_short => :too_short
validates_length_of :as_a, :minimum => 4, :too_short => :too_short
validates_length_of :i_want, :minimum => 7, :too_short => :too_short
Expand Down
2 changes: 1 addition & 1 deletion features/enhanced/client_side_form_validations.feature
Expand Up @@ -53,7 +53,7 @@ Feature: Client side form validations

Examples: List of fields that have character limits
| page name | model | field | value | amount |
| new feature | feature | title | to | 7 |
| new feature | feature | title | to | 4 |
| new feature | feature | in_order | to do | 7 |
| new feature | feature | as_a | use | 4 |
| new feature | feature | i_want | not | 7 |
Expand Down
2 changes: 1 addition & 1 deletion features/plain/form_validations.feature
Expand Up @@ -13,7 +13,7 @@ Feature: Form validations
Examples: Models and their properties
| controller | model | value | property | input_type | selector id | error |
| features | feature | | title | input | feature_title_input | can't be blank |
| features | feature | to | title | input | feature_title_input | Please enter at least 6 characters. |
| features | feature | to | title | input | feature_title_input | Please enter at least 4 characters. |
| features | feature | | in_order | input | feature_title_input | can't be blank |
| features | feature | to do | in_order | input | feature_in_order_input | Please enter at least 7 characters. |
| features | feature | | as_a | input | feature_title_input | can't be blank |
Expand Down
2 changes: 1 addition & 1 deletion public/javascripts/validations/feature.js
@@ -1,7 +1,7 @@
$(document).ready(function () {
$('form.feature').customValidations({
rules: {
"feature[title]": {required: true, minlength: 7,
"feature[title]": {required: true, minlength: 4,
remote: {
url: "/features/validate.json",
type: "get",
Expand Down

0 comments on commit 6eff95d

Please sign in to comment.