<commit_before>'use strict'

describe 'Directive: gravatarSrc', ->
  beforeEach module 'ui.gravatar'
  element = {}

  it 'should set the src attribute with Gravatar URL', inject ($rootScope, $compile) ->
    $rootScope.email = "<EMAIL>"
    element = angular.element '<img gravatar-src="email">'
    element = $compile(element) $rootScope
    $rootScope.$apply()
    expect(element.attr('src')).toBeTruthy()

describe 'Service: gravatarService', ->
  beforeEach module 'ui.gravatar'

  gravatarService = {}
  beforeEach inject (_gravatarService_) ->
    gravatarService = _gravatarService_

  email = '<EMAIL>'
  emailmd5 = '46ab5c60ced85b09c35fd31a510206ef'

  describe '#url:', ->
    it 'should generate an url without parameters to gravatar avatar endpoint', ->
      url = gravatarService.url(email)
      expect(url).toBe 'http://www.gravatar.com/avatar/' + emailmd5

    it 'should generate an url with provided parameters', ->
      opts =
        size: 100
        default: 'mm'
<commit_msg>test(directive): add test for static string<commit_after>'use strict'

describe 'Directive: gravatarSrc', ->
  beforeEach module 'ui.gravatar'
  element = {}

  it 'should set the src attribute with Gravatar URL', inject ($rootScope, $compile) ->
    $rootScope.email = "<EMAIL>"
    element = angular.element '<img gravatar-src="email">'
    element = $compile(element) $rootScope
    $rootScope.$apply()
    expect(element.attr('src')).toBeTruthy()

  it 'should set the src attribute from static src', inject ($rootScope, $compile) ->
    element = angular.element '<img gravatar-src="\'<EMAIL>\'">'
    element = $compile(element) $rootScope
    $rootScope.$apply()
    expect(element.attr('src')).toBeTruthy()

describe 'Service: gravatarService', ->
  beforeEach module 'ui.gravatar'

  gravatarService = {}
  beforeEach inject (_gravatarService_) ->
    gravatarService = _gravatarService_

  email = '<EMAIL>'
  emailmd5 = '46ab5c60ced85b09c35fd31a510206ef'

  describe '#url:', ->
    it 'should generate an url without parameters to gravatar avatar endpoint', ->
      url = gravatarService.url(email)
      expect(url).toBe 'http://www.gravatar.com/avatar/' + emailmd5

    it 'should generate an url with provided parameters', ->
      opts =
        size: 100
        default: 'mm'

{'fraction_non_alphanumeric': 0.1328397212543554, 'fraction_numerical': 0.020905923344947737, 'mean_word_length': 3.7556935817805384, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3990844', 'n_tokens_mistral': 736, 'n_tokens_neox': 693, 'n_words': 184}