chai-backbone-rails 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -2,6 +2,7 @@ Backbone::Chai
2
2
  ==============
3
3
 
4
4
  - Adds Chai matchers for common backbone assertions
5
+ - Adds Chai matchers to assert changes
5
6
  - Adds Chai matchers for common sinon assertions
6
7
  - Adds support for Factories
7
8
 
@@ -116,7 +117,7 @@ There are 2 helper methods to help check if traits are set:
116
117
 
117
118
  and
118
119
 
119
- this.hasTrait('admin') # returns a boolean value
120
+ this.is('admin') # returns a boolean value
120
121
 
121
122
  Extended example:
122
123
 
@@ -124,7 +125,7 @@ Extended example:
124
125
  attributes.gender = @trait('male', 'female') || 'male'
125
126
 
126
127
  returningClass = User
127
- if @hasTrait('admin')
128
+ if @is('admin')
128
129
  returningClass = AdminUser
129
130
 
130
131
  new returningClass attributes
@@ -1,7 +1,7 @@
1
1
  module Chai
2
2
  module Backbone
3
3
  module Rails
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
6
6
  end
7
7
  end
@@ -32,7 +32,7 @@ window.Factory =
32
32
  factory: f.factory
33
33
  sequence: sequencer
34
34
  traits: traits
35
- hasTrait: (name) -> ~@traits.indexOf(name)
35
+ is: (name) -> ~@traits.indexOf(name)
36
36
  trait: (names...) ->
37
37
  for name in @traits
38
38
  return name if ~names.indexOf(name)
@@ -45,11 +45,11 @@ describe 'Factory', ->
45
45
  result = Factory.create 'something-with-traits'
46
46
  result.traits.should.deep.equal ['something', 'with']
47
47
 
48
- describe '#hasTrait', ->
48
+ describe '#is', ->
49
49
 
50
50
  it 'checks if trait is set', ->
51
51
  Factory.define 'hasTrait', ->
52
- @hasTrait('hello')
52
+ @is('hello')
53
53
 
54
54
  Factory.create('hello-hasTrait').should.be.ok
55
55
  Factory.create('bye-hasTrait').should.not.be.ok
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chai-backbone-rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 0
10
- version: 0.3.0
9
+ - 1
10
+ version: 0.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matthijs Groen