-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3963906
Showing
11 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# FactoryGirl Snippets for Sublime Text 2/3 | ||
|
||
## Included Snippets | ||
|
||
`fac` -> `factory :name, :class, :parent, :aliases do ... end` | ||
|
||
`seq` -> `sequence(:attribute, initial value) { |n| "#{n}" }` | ||
|
||
`fgaf` -> `attributes_for(:model, attributes)` | ||
|
||
`fgc` -> `create(:model, attributes)` | ||
|
||
`fgcl` -> `create_list(:model, 3, attributes)` | ||
|
||
`fgb` -> `build(:model, attributes)` | ||
|
||
`fgbs` -> `build_stubbed(:model, attributes)` | ||
|
||
`fgbl` -> `build_list(:model, 3, attributes)` | ||
|
||
`after` -> `after(:create|:build|:stub) { |resource| ... }` | ||
|
||
`before` -> `before(:create) { |resource| ... }` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[after(:${1:create}) { |${2:resource}| $0 }]]></content> | ||
<tabTrigger>after</tabTrigger> | ||
<scope>source.ruby, source.ruby.rails, source.ruby.rspec</scope> | ||
<description>after(:create|:build|:stub) { |resource| ... }</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[attributes_for(:${1:model}${2:, ${3:attributes}})]]></content> | ||
<tabTrigger>fgc</tabTrigger> | ||
<scope>source.ruby, source.ruby.rails, source.ruby.rspec</scope> | ||
<description>attributes_for(:model, attributes)</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[before(:create) { |${1:resource}| $0 }]]></content> | ||
<tabTrigger>before</tabTrigger> | ||
<scope>source.ruby, source.ruby.rails, source.ruby.rspec</scope> | ||
<description>before(:create) { |resource| ... }</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[build(:${1:model}${2:, ${3:attributes}})]]></content> | ||
<tabTrigger>fgb</tabTrigger> | ||
<scope>source.ruby, source.ruby.rails, source.ruby.rspec</scope> | ||
<description>build(:model, attributes)</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[build_list(:${1:model}, ${2:3}${3:, ${4:attributes}})]]></content> | ||
<tabTrigger>fgbl</tabTrigger> | ||
<scope>source.ruby, source.ruby.rails, source.ruby.rspec</scope> | ||
<description>build_list(:model, 3, attributes)</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[build_stubbed(:${1:model}${2:, ${3:attributes}})]]></content> | ||
<tabTrigger>fgbs</tabTrigger> | ||
<scope>source.ruby, source.ruby.rails, source.ruby.rspec</scope> | ||
<description>build_stubbed(:model, attributes)</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[create(:${1:model}${2:, ${3:attributes}})]]></content> | ||
<tabTrigger>fgc</tabTrigger> | ||
<scope>source.ruby, source.ruby.rails, source.ruby.rspec</scope> | ||
<description>create(:model, attributes)</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[create_list(:${1:model}, ${2:3}${3:, ${4:attributes}})]]></content> | ||
<tabTrigger>fgbl</tabTrigger> | ||
<scope>source.ruby, source.ruby.rails, source.ruby.rspec</scope> | ||
<description>create_list(:model, 3, attributes)</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<snippet> | ||
<content><![CDATA[factory :${1:name}${2:${3:, class: ${4:model}}${5:, parent: :${6:factory}}${7:, aliases: [:${8:alias}]}} do | ||
$0 | ||
end]]></content> | ||
<tabTrigger>fac</tabTrigger> | ||
<scope>source.ruby, source.ruby.rails, source.ruby.rspec</scope> | ||
<description>factory :name, :class, :parent, :aliases do ... end</description> | ||
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<snippet> | ||
<content><![CDATA[sequence(:${1:attribute}${2:, initial value}) { |n| ${0:"#{n\}"} }]]></content> | ||
<tabTrigger>seq</tabTrigger> | ||
<scope>source.ruby, source.ruby.rails, source.ruby.rspec</scope> | ||
<description>sequence(:attribute) { ... }</description> | ||
</snippet> |