Sha256: d02547240fad517ae65dc9e79d49be5ecd55467efd7bbe7b5b044f1b303d00b8

Contents?: true

Size: 968 Bytes

Versions: 7

Compression:

Stored size: 968 Bytes

Contents

# coding: utf-8

require 'test_helper'

class RenderKeywordsClass < ActionView::TestCase
  test 'simple' do
    assert_equal render_keywords, '<meta name="keywords" content="keywords" />'
  end
  
  test '@keywords' do
    @keywords = '@keywords'
    assert_equal render_keywords, '<meta name="keywords" content="@keywords" />'
    @keywords = ['@keywords', '   ', '', nil]
    assert_equal render_keywords, '<meta name="keywords" content="@keywords" />'
    ['   ', '', nil].each do |key|
      @keywords = key
      assert_equal render_keywords, ''
    end
  end
  
  test '@item' do
    @item = Item.new
    assert_equal render_keywords, '<meta name="keywords" content="item,item_keywords" />'
  end

  test 'opts' do
    assert_equal render_keywords(keywords: 'opts,a,b,c'), '<meta name="keywords" content="opts,a,b,c" />'
  end
end

class HelperSettings
  def self.keywords
    'keywords'
  end
end

class Item
  def keywords
    'item,item_keywords'
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
h2ocube_rails_helper-0.0.16 test/render_keywords_test.rb
h2ocube_rails_helper-0.0.15 test/render_keywords_test.rb
h2ocube_rails_helper-0.0.14 test/render_keywords_test.rb
h2ocube_rails_helper-0.0.13 test/render_keywords_test.rb
h2ocube_rails_helper-0.0.12 test/render_keywords_test.rb
h2ocube_rails_helper-0.0.11 test/render_keywords_test.rb
h2ocube_rails_helper-0.0.10 test/render_keywords_test.rb