/* global describe:false */
/* global it */
/* global expect */

/*!
 * Module dependencies.
 */

var html = require('../../../lib/cordova-linter/util/html');

/*!
 * Specification: Project Operations
 */

describe('html', function() {
    describe('html.findJs(htmlString)', function() {

        describe('when no src attribute', function () {
            it('should return text', function () {
                expect(html.findJs('<script>var foo = null;</script>')[0].text).toEqual('var foo = null;');
            });
        });

        describe('when src attribute present', function () {
            it('should return src', function () {
                expect(html.findJs('<script src="foo.js"></script>')[0].src).toEqual('foo.js');
            });
        });
    });
});

@@ -571,16 +571,35 @@
  present
+ and no type is set
 ', funct
@@ -776,24 +776,307 @@
 %0A        %7D);
+%0A%0A        describe('when src attribute present and type is set', function () %7B%0A            it('should return src', function () %7B%0A                expect(html.findJs('%3Cscript type=%22text/javascript%22 src=%22cordova.js%22%3E%3C/script%3E')%5B0%5D.src).toEqual('cordova.js');%0A            %7D);%0A        %7D);
 %0A    %7D);%0A%7D);

add spec