<commit_before>namespace app.guest.articles.article {

    describe('Article (public)', () => {

        let article:common.models.Article = common.models.ArticleMock.entity(),
            $rootScope:global.IRootScope,
            $scope:ng.IScope,
            articleService:common.services.article.ArticleService,
            ArticleController:app.guest.articles.article.ArticleController,
            ngJwtAuthService:NgJwtAuth.NgJwtAuthService,
            user:common.models.User = common.models.UserMock.entity(),
            $stateParams:IArticleStateParams = <IArticleStateParams> {
                permalink: 'foobar'
            };

        beforeEach(() => {

            module('app');

            inject(($controller, _$rootScope_, _articleService_, _ngJwtAuthService_) => {
                $rootScope = _$rootScope_;
                $scope = $rootScope.$new();
                articleService = _articleService_;
                ngJwtAuthService = _ngJwtAuthService_;

                articleService.getArticle = sinon.stub().returns(article);

                ngJwtAuthService.getUser = sinon.stub().returns(user);

                ArticleController = $controller(app.guest.articles.article.namespace + '.controller', {
                    $stateParams: $stateParams,
                    article: article,
                });
            });

        });

        it('should have an injected article', () => {

            expect(ArticleController.article).to.be.an.instanceOf(common.models.Article);

        });

        it('should be able to resolve the article', () => {

            let article = (<any>ArticleConfig.state.resolve).article(articleService, $stateParams);

            expect(articleService.getArticle).to.have.been.calledWith('foobar', ['articlePermalinks', 'articleMetas', 'tags', 'author', 'comments', 'sections']);

            expect(article).to.deep.equal(article);

        });

        it('should be able to resolve the user', () => {

            let retrievedUser = (<any>ArticleConfig.state.resolve).user(ngJwtAuthService);
<commit_msg>Updating guest article test to include newly added $state.<commit_after>namespace app.guest.articles.article {

    describe('Article (public)', () => {

        let article:common.models.Article = common.models.ArticleMock.entity(),
            $rootScope:global.IRootScope,
            $scope:ng.IScope,
            articleService:common.services.article.ArticleService,
            ArticleController:app.guest.articles.article.ArticleController,
            ngJwtAuthService:NgJwtAuth.NgJwtAuthService,
            user:common.models.User = common.models.UserMock.entity(),
            $stateParams:IArticleStateParams = <IArticleStateParams> {
                permalink: 'foobar'
            },
            $state:ng.ui.IStateService;

        beforeEach(() => {

            module('app');

            inject(($controller, _$rootScope_, _articleService_, _ngJwtAuthService_, _$state_) => {
                $rootScope = _$rootScope_;
                $scope = $rootScope.$new();
                articleService = _articleService_;
                ngJwtAuthService = _ngJwtAuthService_;
                $state = _$state_;

                articleService.getArticle = sinon.stub().returns(article);

                ngJwtAuthService.getUser = sinon.stub().returns(user);

                $state.current.data = [];

                ArticleController = $controller(app.guest.articles.article.namespace + '.controller', {
                    $stateParams: $stateParams,
                    article: article,
                    $state: $state
                });
            });

        });

        it('should have an injected article', () => {

            expect(ArticleController.article).to.be.an.instanceOf(common.models.Article);

        });

        it('should be able to resolve the article', () => {

            let article = (<any>ArticleConfig.state.resolve).article(articleService, $stateParams);

            expect(articleService.getArticle).to.have.been.calledWith('foobar', ['articlePermalinks', 'articleMetas', 'tags', 'author', 'comments', 'sections']);

            expect(article).to.deep.equal(article);

        });

        it('should be able to resolve the user', () => {

            let retrievedUser = (<any>ArticleConfig.state.resolve).user(ngJwtAuthService);

{'fraction_non_alphanumeric': 0.12602927721866422, 'fraction_numerical': 0.0, 'mean_word_length': 2.2178072111846947, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7583413', 'n_tokens_mistral': 1210, 'n_tokens_neox': 1109, 'n_words': 171}