diff options
| author | mo <mokha@cisco.com> | 2017-05-04 16:45:10 -0600 |
|---|---|---|
| committer | mo <mokha@cisco.com> | 2017-05-04 16:45:10 -0600 |
| commit | 84fedee67ee3b086eb4db4a82e756c3855e8382d (patch) | |
| tree | bff5dd3d453d329f2c9607d580375a58d56c01d6 /spec/javascripts/backbone | |
| parent | 8fdd31578f85a72440985b9f8918f3999268c937 (diff) | |
upgrade teaspoon.
Diffstat (limited to 'spec/javascripts/backbone')
| -rw-r--r-- | spec/javascripts/backbone/models/cake_spec.js.coffee | 12 | ||||
| -rw-r--r-- | spec/javascripts/backbone/views/cake_view_spec.js.coffee | 8 |
2 files changed, 10 insertions, 10 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$/) diff --git a/spec/javascripts/backbone/views/cake_view_spec.js.coffee b/spec/javascripts/backbone/views/cake_view_spec.js.coffee index f596ddce..5c61f37f 100644 --- a/spec/javascripts/backbone/views/cake_view_spec.js.coffee +++ b/spec/javascripts/backbone/views/cake_view_spec.js.coffee @@ -2,15 +2,15 @@ describe "CakeSide.Views.Cakes.CakeView", -> cake = new CakeSide.Models.Cake id: '1' name: 'chocolate' - view = new CakeSide.Views.Cakes.CakeView + subject = new CakeSide.Views.Cakes.CakeView model: cake describe "when there are no photos", -> beforeEach -> - view.render() + subject.render() it 'renders the cake', -> - expect(view.$el.html()).toMatch(/chocolate/) + expect(subject.$el.html()).toMatch(/chocolate/) it 'does not display any photos', -> - expect(view.$el.html()).not.toMatch(/img/) + expect(subject.$el.html()).not.toMatch(/img/) |
