<commit_before>require 'test_helper'
require '/home/arousseau/dev/ruby/raspberry_cook/app/helpers/lazy_image_helper.rb'

class RecipeHelperTest < ActionView::TestCase

  include LazyImageHelper

  test "should create image tag with lazy loader" do
    # simple use
    assert_equal '<img data-src="/images/github.svg" class="lazyload" src="/images/default.svg" alt="github" />', lazy_image_tag('github.svg')

    assert_equal '<img data-src="/images/github.svg" class="test lazyload" src="/images/default.svg" alt="github" />', lazy_image_tag('github.svg', class: 'test')

    assert_equal '<img  data-src="/images/github.svg" class="test lazyload" src="/images/default.svg" alt="hello" />', lazy_image_tag('github.svg', class: 'test', alt: 'hello')
  end


end<commit_msg>Correct order of html attributes for unit tests<commit_after>require 'test_helper'
require '/home/arousseau/dev/ruby/raspberry_cook/app/helpers/lazy_image_helper.rb'

class RecipeHelperTest < ActionView::TestCase

  include LazyImageHelper

  test "should create image tag with lazy loader" do
    # simple use
    assert_equal '<img data-src="http://test.host/images/github.svg" class="lazyload" src="http://test.host/images/default.svg" alt="Default" />', lazy_image_tag('github.svg')

    assert_equal '<img class="test lazyload" data-src="http://test.host/images/github.svg" src="http://test.host/images/default.svg" alt="Default" />', lazy_image_tag('github.svg', class: 'test')

    assert_equal '<img class="test lazyload" alt="hello" data-src="http://test.host/images/github.svg" src="http://test.host/images/default.svg" />', lazy_image_tag('github.svg', class: 'test', alt: 'hello')
  end


end
{'fraction_non_alphanumeric': 0.16219439475253428, 'fraction_numerical': 0.0, 'mean_word_length': 5.284644194756554, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '1199048', 'n_tokens_mistral': 548, 'n_tokens_neox': 542, 'n_words': 108}