angular-ui/bootstrap — pull request #1502 by Foxandxss (2013-12-31 17:39:03+00:00)
Title: test(carousel): removing stale code

I want to propose some minor changes and I want to open a discussion about this concrete test.

First the changes:

`elm` is created twice, the outer one is not needed.

`carouselScope` is never used and the one that is used is just one test and it already shadow/hide the outer one.

Some styling changes (to match what is done in the entire file even when I like some spaces (check #1490)).

The major change is removing some `expect`. That test is to test that changing the "model" changes the slides. No need to again that removing stuff does certain things, That is done in the preview test.

About the discussion...

Is that $apply syntax pretty? I know that is a lot less lines than doing the assign + `$digest` or putting a function inside the `$apply`. But that way you ignore any error tracking that could be important or not, but good practices is always better.

What's the problem with just using `$digest` ? All the tests I saw for directives uses `$digest` because is faster (that includes the others tests I already checked in this suite).

And I have a question, is the afterEach needed? I guess that it is to prevent leaking. So what's leaking here? (Serious question, not sarcastic :P).