Merge branch 'shoulda_matchers' of git://github.com/babybeasimple/vim-snippets into babybeasimple-shoulda_matchers
* 'shoulda_matchers' of git://github.com/babybeasimple/vim-snippets: add rspec shoulda matchers snippets make rspec section definiton comment more readable move accepts_nested_attributes_for to attributes section Conflicts: snippets/ruby.snippets
This commit is contained in:
commit
68532499e5
@ -164,7 +164,8 @@ snippet atp
|
||||
attr_protected :${1:attr_names}
|
||||
snippet ata
|
||||
attr_accessible :${1:attr_names}
|
||||
|
||||
snippet ana
|
||||
accepts_nested_attributes_for :${1:association}
|
||||
# ivc == instance variable cache
|
||||
snippet ivc
|
||||
@${1:variable_name} ||= ${2:chached_value}
|
||||
@ -947,7 +948,9 @@ snippet tre
|
||||
${3}
|
||||
snippet tref
|
||||
t.references :${1:model}
|
||||
#rspec
|
||||
########################################
|
||||
# Rspec snippets - see below #
|
||||
########################################
|
||||
snippet it
|
||||
it "${1:spec_name}" do
|
||||
${2}
|
||||
@ -1003,5 +1006,62 @@ snippet shared
|
||||
shared_examples "${1:shared examples name}" ${2}
|
||||
snippet itb
|
||||
it_behaves_like "${1:shared examples name}"${2}
|
||||
snippet ana
|
||||
accepts_nested_attributes_for :${1:association}
|
||||
#ShouldaMatchers#ActionController
|
||||
snippet sfp
|
||||
it { should filter_param :${1:key} }
|
||||
snippet srt
|
||||
it { should redirect_to ${1:url} }
|
||||
snippet srtp
|
||||
it { should render_template ${1} }
|
||||
snippet srwl
|
||||
it { should render_with_layout ${1} }
|
||||
snippet srf
|
||||
it { should rescue_from ${1:exception} }
|
||||
snippet srw
|
||||
it { should respond_with ${1:status} }
|
||||
snippet sr
|
||||
it { should route(:${1:method}, '${2:path}') }
|
||||
snippet sss
|
||||
it { should set_session :${1:key} }
|
||||
snippet ssf
|
||||
it { should set_the_flash('${1}') }
|
||||
#ShouldaMatchers#ActiveModel
|
||||
snippet sama
|
||||
it { should allow_mass_assignment_of :${1} }
|
||||
snippet sav
|
||||
it { should allow_value(${1}) }
|
||||
snippet see
|
||||
it { should ensure_exclusion_of :${1} }
|
||||
snippet sei
|
||||
it { should ensure_inclusion_of :${1} }
|
||||
snippet sel
|
||||
it { should ensure_length_of :${1} }
|
||||
snippet sva
|
||||
it { should validate_acceptance_of :${1} }
|
||||
snippet svc
|
||||
it { should validate_confirmation_of :${1} }
|
||||
snippet svn
|
||||
it { should validate_numericality_of :${1} }
|
||||
snippet svp
|
||||
it { should validate_presence_of :${1} }
|
||||
snippet svu
|
||||
it { should validate_uniqueness_of :${1} }
|
||||
#ShouldaMatchers#ActiveRecord
|
||||
snippet sana
|
||||
it { should accept_nested_attributes_for :${1} }
|
||||
snippet sb
|
||||
it { should belong_to :${1} }
|
||||
snippet shbtm
|
||||
it { should have_and_belong_to_many :${1} }
|
||||
snippet shc
|
||||
it { should have_db_column :${1} }
|
||||
snippet shi
|
||||
it { should have_db_index :${1} }
|
||||
snippet shm
|
||||
it { should have_many :${1} }
|
||||
snippet sho
|
||||
it { should have_one :${1} }
|
||||
snippet shroa
|
||||
it { should have_readonly_attribute :${1} }
|
||||
snippet ss
|
||||
it { should serialize :${1} }
|
||||
|
Loading…
x
Reference in New Issue
Block a user