AgileVentures / asyncvoter-slack-bot

0 stars 0 forks source link

[WIP] Add cucumber testing #16

Closed arreche closed 7 years ago

arreche commented 7 years ago

closes #12

arreche commented 7 years ago

=============================== Coverage summary =============================== Statements : 94.87% ( 37/39 ) Branches : 50% ( 1/2 ) Functions : 90% ( 9/10 ) Lines : 94.87% ( 37/39 )

tansaku commented 7 years ago

great work @arreche and @mtc2013

however I wouldn't delete the controller test myself ... I know that ultimately is does the same thing at the moment, but having a working example of both those types of tests is important I think ...

arreche commented 7 years ago

I just not sure if we should continue maintaining and running those test for the sake of having examples. But we could restore it back here. (Despite this file will always available in our repo.)

What is wrong the lovely examples placed in the BotMock repo? :trollface:

tansaku commented 7 years ago

@arreche the ones in the botmock repo don't work for us - I had to edit them to remove callbacks and other jiggery poky to get them to work.

You're right that we'll still have that example in the repo (I forgot we are on a new PR now) but the pattern that we have in our other projects is a combination of Acceptance, Integration and Unit tests.

We usually (but not always) have the acceptance tests in cucumber, then some integration and unit in RSpec (equiv to Mocha). Generally the cukes are slower to run, so some integration tests in the lower level are appropriate.

I think deleting code and tests is great, but I think slack bot is still just something we are spiking both in terms of tests and app code to experiment with what we can do ...

Maybe open a ticket to remove them and we can vote on it and do their removal in another PR?

arreche commented 7 years ago

@tansaku I added the tests back. Anything else for this PR?

tansaku commented 7 years ago

I think this is good as a spike of the cucumber tests @arreche - many thanks to you and @mtc2013 for working on it.

I think the key addition now is the full feature user stories at the top of each cuke, and a gradual polishing to more declarative cukes:

http://itsadeliverything.com/declarative-vs-imperative-gherkin-scenarios-for-cucumber

also pulling in a bigger set of other stories but I'll open a ticket for that ...