https://github.com/sn0cr/shoulda-sublime-snippets
Snippets for Sublime Text 2 for the shoulda-matchers gem
https://github.com/sn0cr/shoulda-sublime-snippets
Last synced: 3 months ago
JSON representation
Snippets for Sublime Text 2 for the shoulda-matchers gem
- Host: GitHub
- URL: https://github.com/sn0cr/shoulda-sublime-snippets
- Owner: sn0cr
- License: mit
- Created: 2013-04-29T18:18:14.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2016-10-01T13:12:42.000Z (over 8 years ago)
- Last Synced: 2025-01-23T20:35:00.186Z (5 months ago)
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Shoulda matcher snippets for Sublime text 2
______________________________## Get started
```bash
cd /to/your/sublime/packages/dir
git clone https://github.com/sn0cr/shoulda-sublime-snippets.git
```## Snippets
### Active Model
```ruby
itsvp: it { should validate_presence_of(:tab) }
itsvu: it { should validate_uniqueness_of(:tab) }
itsei: it { should ensure_inclusion_of(:tab).in_array(["a", "b"])}
```
### Active Record```ruby
itsbt: it { should belong_to(:tab)}
itshm: it { should have_many(:tabs)}
```
### Active Controller```ruby
itsrw: it {should respond_with(:tabs)}
itsrt: it { should render_template("tabs/all")}
```