Skip to content

Commit

Permalink
Added snippets for some shoulda helper methods.
Browse files Browse the repository at this point in the history
Signed-off-by: Reza Jelveh <toyb0mb@gmx.net>

Signed-off-by: Martin Grenfell <martin_grenfell@msn.com>
  • Loading branch information
Jason Ong authored and Martin Grenfell committed Aug 8, 2009
1 parent 53968e7 commit 7b2c339
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 0 deletions.
File renamed without changes.
5 changes: 5 additions & 0 deletions ruby-shoulda/context.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
context "${1:context}" do

${2}

end
1 change: 1 addition & 0 deletions ruby-shoulda/samao.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
should_allow_mass_assignment_of :${1:field}
1 change: 1 addition & 0 deletions ruby-shoulda/savf.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
should_allow_values_for :${1:field}, "${2:value}"
1 change: 1 addition & 0 deletions ruby-shoulda/sbt.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
should_belong_to :${1:field}
1 change: 1 addition & 0 deletions ruby-shoulda/selir.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
should_ensure_length_in_range :${1:field}, ${2:start}..${3:end}
3 changes: 3 additions & 0 deletions ruby-shoulda/setup.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
setup do
${1}
end
1 change: 1 addition & 0 deletions ruby-shoulda/sevir.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
should_ensure_value_in_range :${1:field}, ${2:start}..${3:end}
1 change: 1 addition & 0 deletions ruby-shoulda/shm.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
should_have_many :${1:field}
1 change: 1 addition & 0 deletions ruby-shoulda/snamao.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
should_not_allow_mass_assignment_of :${1:field}
1 change: 1 addition & 0 deletions ruby-shoulda/snavf.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
should_not_allow_values_for :${1:field}, "${2:value}"
1 change: 1 addition & 0 deletions ruby-shoulda/svao.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
should_validate_acceptance_of :${1:field}
1 change: 1 addition & 0 deletions ruby-shoulda/svno.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
should_validate_numericality_of :${1:field}
1 change: 1 addition & 0 deletions ruby-shoulda/svpo.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
should_validate_presence_of :${1:field}
1 change: 1 addition & 0 deletions ruby-shoulda/svuo.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
should_validate_uniqueness_of :${1:field}, :scoped_to => ${2:arrayofnames}

0 comments on commit 7b2c339

Please sign in to comment.