Sha256: 33dc3e6c4710f0126a0ec88076e9425c2469bb1176ad3bf8ab37a64f173a77dd

Contents?: true

Size: 1.17 KB

Versions: 33

Compression:

Stored size: 1.17 KB

Contents

require 'rails_helper'

module MyForum
  RSpec.describe PostsHelper, type: :helper do
    describe 'Youtube' do
      it 'should parse youtube links' do
        {
          'some text https://www.youtube.com/watch?v=HX-Jz3GESM0 text'  => "some text <iframe width='560' height='315' src='https://www.youtube.com/embed/HX-Jz3GESM0' frameborder='0' allowfullscreen></iframe> text",
          'some text https://www.youtube.com/watch?v=IEmU6Oqpx7E text'  => "some text <iframe width='560' height='315' src='https://www.youtube.com/embed/IEmU6Oqpx7E' frameborder='0' allowfullscreen></iframe> text",
          'some text http://youtu.be/croRTTsFtdw'                       => "some text <iframe width='560' height='315' src='https://www.youtube.com/embed/croRTTsFtdw' frameborder='0' allowfullscreen></iframe>",
          'http://www.youtube.com/watch?v=TsDbnX_YgU4#ws'               => "<iframe width='560' height='315' src='https://www.youtube.com/embed/TsDbnX_YgU4' frameborder='0' allowfullscreen></iframe>#ws"

        }.each do |text, formatted_text|
          expect(format_bbcode(text.dup)).to eq formatted_text
        end
      end

    end

    def emoticons_list
      []
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
my_forum-0.0.2.4 spec/helpers/my_forum/posts_helper_spec.rb
my_forum-0.0.2.3 spec/helpers/my_forum/posts_helper_spec.rb
my_forum-0.0.2.2 spec/helpers/my_forum/posts_helper_spec.rb
my_forum-0.0.2.1 spec/helpers/my_forum/posts_helper_spec.rb
my_forum-0.0.2 spec/helpers/my_forum/posts_helper_spec.rb
my_forum-0.0.1.beta60 spec/helpers/my_forum/posts_helper_spec.rb
my_forum-0.0.1.beta59 spec/helpers/my_forum/posts_helper_spec.rb
my_forum-0.0.1.beta58 spec/helpers/my_forum/posts_helper_spec.rb
my_forum-0.0.1.beta57 spec/helpers/my_forum/posts_helper_spec.rb
my_forum-0.0.1.beta56 spec/helpers/my_forum/posts_helper_spec.rb
my_forum-0.0.1.beta55 spec/helpers/my_forum/posts_helper_spec.rb
my_forum-0.0.1.beta54 spec/helpers/my_forum/posts_helper_spec.rb
my_forum-0.0.1.beta53 spec/helpers/my_forum/posts_helper_spec.rb
my_forum-0.0.1.beta52 spec/helpers/my_forum/posts_helper_spec.rb
my_forum-0.0.1.beta51 spec/helpers/my_forum/posts_helper_spec.rb
my_forum-0.0.1.beta50 spec/helpers/my_forum/posts_helper_spec.rb
my_forum-0.0.1.beta49 spec/helpers/my_forum/posts_helper_spec.rb
my_forum-0.0.1.beta48 spec/helpers/my_forum/posts_helper_spec.rb
my_forum-0.0.1.beta47 spec/helpers/my_forum/posts_helper_spec.rb
my_forum-0.0.1.beta46 spec/helpers/my_forum/posts_helper_spec.rb