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 text", 'some text https://www.youtube.com/watch?v=IEmU6Oqpx7E text' => "some text text", 'some text http://youtu.be/croRTTsFtdw' => "some text ", 'http://www.youtube.com/watch?v=TsDbnX_YgU4#ws' => "#ws" }.each do |text, formatted_text| expect(format_bbcode(text.dup)).to eq formatted_text end end end def emoticons_list [] end end end