An open API service indexing awesome lists of open source software.

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

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")}
```