Sha256: ab5a491f577c099109822e503c69345c0f7b9e7ff79e93b24e246a0a3d600ce7

Contents?: true

Size: 1.09 KB

Versions: 26

Compression:

Stored size: 1.09 KB

Contents

module MercuryContentsHelpers
  def contents_for(name)
    case name
      when 'simple content' then "this is <span>simple</span> <b>content</b>"
      when 'justifiable content' then "<div>first line</div><br/>this is <span>justifiable</span> <b>content</b>"
      when 'wrapped content' then "<span>this <a href='http://google.com'>is</a> <i>wrapped</i> <b>content</b></span>"
      when 'an image' then "this is <img src='/assets/mercury/temp-logo.png'> <b>content</b>"
      when 'a table' then "this is a <table><tr><td><span>1</span></td><td><span>2</span></td></tr><tr><td><span>3</span></td><td><span>4</span></td></tr></table> <b>content</b>"
      when 'the snippet', 'that snippet' then "<div class='mercury-snippet' data-snippet='#{@snippet_id || 'snippet_42'}'>#{@snippet_id || 'snippet_42'}</div> <b>content</b>"

      else name
    end
  end

  def parse_snippet_options_from(options_string)
    json = []
    options_string.scan(/(?:,\s)?([^:]*): ("[^"]*")/).each do |pair|
      json << %Q{'options[#{pair[0]}]': #{pair[1]}}
    end

    "{#{json.join(', ')}}"
  end
end

World(MercuryContentsHelpers)

Version data entries

26 entries across 26 versions & 3 rubygems

Version Path
kiteditor-1.0.25 features/support/mercury_contents.rb
kiteditor-1.0.24 features/support/mercury_contents.rb
kiteditor-1.0.23 features/support/mercury_contents.rb
kiteditor-1.0.22 features/support/mercury_contents.rb
kiteditor-1.0.21 features/support/mercury_contents.rb
kiteditor-1.0.20 features/support/mercury_contents.rb
kiteditor-1.0.19 features/support/mercury_contents.rb
kiteditor-1.0.18 features/support/mercury_contents.rb
kiteditor-1.0.17 features/support/mercury_contents.rb
kiteditor-1.0.16 features/support/mercury_contents.rb
kiteditor-1.0.14 features/support/mercury_contents.rb
kiteditor-1.0.13 features/support/mercury_contents.rb
kiteditor-1.0.11 features/support/mercury_contents.rb
kiteditor-1.0.10 features/support/mercury_contents.rb
kiteditor-1.0.9 features/support/mercury_contents.rb
kiteditor-1.0.8 features/support/mercury_contents.rb
kiteditor-1.0.7 features/support/mercury_contents.rb
kiteditor-1.0.6 features/support/mercury_contents.rb
kiteditor-1.0.5 features/support/mercury_contents.rb
kiteditor-1.0.4 features/support/mercury_contents.rb