summaryrefslogtreecommitdiff
path: root/spec/javascripts/backbone/models/cake_spec.js.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'spec/javascripts/backbone/models/cake_spec.js.coffee')
-rw-r--r--spec/javascripts/backbone/models/cake_spec.js.coffee12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/javascripts/backbone/models/cake_spec.js.coffee b/spec/javascripts/backbone/models/cake_spec.js.coffee
index e69b3f6b..4223a255 100644
--- a/spec/javascripts/backbone/models/cake_spec.js.coffee
+++ b/spec/javascripts/backbone/models/cake_spec.js.coffee
@@ -1,19 +1,19 @@
describe "CakeSide.Models.Cake", ->
- createSUT = (attributes) ->
+ subject = (attributes) ->
new CakeSide.Models.Cake(attributes)
describe "#validate", ->
it "returns an error when the name is null", ->
attributes =
name: null
- cake = createSUT(attributes)
+ cake = subject(attributes)
expect(cake.validate(attributes, {})).not.toBe(null)
expect(cake.isValid()).toBeFalsy()
it "returns an error when the name is blank", ->
attributes =
name: ' '
- cake = createSUT(attributes)
+ cake = subject(attributes)
expect(cake.validate(attributes, {})).not.toBe(null)
expect(cake.isValid()).toBeFalsy()
@@ -22,7 +22,7 @@ describe "CakeSide.Models.Cake", ->
attributes =
name: 'hi'
category_id: null
- cake = createSUT(attributes)
+ cake = subject(attributes)
expect(cake.validate(attributes)).not.toBe(null)
expect(cake.isValid()).toBeFalsy()
@@ -30,11 +30,11 @@ describe "CakeSide.Models.Cake", ->
attributes =
name: 'hi'
category_id: 1
- cake = createSUT(attributes)
+ cake = subject(attributes)
expect(cake.validate(attributes)).toBeUndefined()
expect(cake.isValid()).toBeTruthy()
describe "#public_url", ->
it "returns the correct url", ->
- result = createSUT(slug: '123-cake').public_url()
+ result = subject(slug: '123-cake').public_url()
expect(result).toMatch(/^http:\/\/.+\/creations\/123-cake$/)