Skip to content

Instantly share code, notes, and snippets.

@MandarinConLaBarba
Created February 28, 2013 11:12
Show Gist options
  • Save MandarinConLaBarba/5056009 to your computer and use it in GitHub Desktop.
Save MandarinConLaBarba/5056009 to your computer and use it in GitHub Desktop.
describe("flows.example.splash", function() {
describe("steps", function() {
describe("login-user", function() {
beforeEach(function() {
//Get the step
var target = sebastian.flow("flows.example.splash").step("login-user"),
//Dummy up a context
context = {
user : {
set : sinon.stub()
login : sinon.stub()
}
}
//Call the step
target.callback.call(context);
});
it("should set the userName", function() {
context.user.set.withArgs("userName").called.should.be.true;
});
it("should set the password", function() {
context.user.set.withArgs("password").called.should.be.true;
});
it("should call the user login method", function() {
context.user.login.called.should.be.true;
});
})
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment