Hello,
I’ve recently been back playing around with Velocity and was hoping to get some feedback on the appropriate usage of Jasmine. I’ve been using it somewhat like I would use rspec in rails (see example test below). I’m driving the UI with Jasmine and also directly accessing the database. Not sure if this is the way Jasmine is supposed to be used, as many of the examples I’ve looked at make use of spies etc. and don’t seem to interact with the DB.
Is Cucumber more appropriate for the type of testing I am doing? I’ve tried cucumber with both .NET and Rails applications in the past and have never really enjoyed it, I find something like rspec much easier to work with. Having said that if it’s the more appropriate way to go, maybe I need to bite the bullet and give it another try.
Thanks for any feedback!
Example test:
describe ("the todo page", function() {
describe ("remove task", function() {
beforeAll(function() {
FactoryBoy.create('task');
});
afterAll(function() {
FactoryBoy.destroyAll('task');
})
it ("should remove a task when the delete button is clicked", function() {
// remove the task
$('.delete').click();
// ensure it is not in the database
expect(Tasks.find().count()).toEqual(0);
// ensure it is not in the UI
expect($('li').size()).toEqual(0);
});
});
});