From 84fedee67ee3b086eb4db4a82e756c3855e8382d Mon Sep 17 00:00:00 2001 From: mo Date: Thu, 4 May 2017 16:45:10 -0600 Subject: upgrade teaspoon. --- spec/javascripts/backbone/models/cake_spec.js.coffee | 12 ++++++------ spec/javascripts/backbone/views/cake_view_spec.js.coffee | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'spec/javascripts/backbone') 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/) -- cgit v1.2.3