You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
calling resource.expect creates an expectation, calling .with causes the expectation to pass/fail depending on those parameters, calling .with would chain the expected parameters so that each would need to pass.
varexpectation;// Instantiate it so it can be shared between callsbeforeEach(function(){expectation=resource.expect('POST');// every it block now requires a post to happen});it("should expect a post",function(){// Fails because we don't click save});it("should succeed post happens with any parameters",function(){click('Create');// succeeds with any parameters});context("with a name",function(){beforeEach(function(){expectation.with({name: 'Joey'});// now requires the parameters {name: 'Joey'}fill('Name').with('Joey');});it("should send up the patient's name",function(){click('Create');});describe("with a phone number",function(){it("should send up the phone number",function(){fill('Phone number').with('415-555-1234');expectation.with({phone_number: '415-555-1234'});// Extends the expectation, now requires name: 'Joey' and phone_number: '415-555-1234'click('Create');});});});``
The text was updated successfully, but these errors were encountered:
calling
resource.expect
creates an expectation, calling.with
causes the expectation to pass/fail depending on those parameters, calling.with
would chain the expected parameters so that each would need to pass.The text was updated successfully, but these errors were encountered: