require 'spec_helper' RSpec.describe Sociyal::Widget do let(:view) { ActionView::Base.new } describe '#to_s' do context 'no options specified' do subject { described_class.new(view).to_s } let(:expected) do '
'.gsub(/\s+/, ' ') end it { is_expected.to eq(expected) } end context 'one service specified' do subject { described_class.new(view, services: 'vkontakte').to_s } let(:expected) do '
'.gsub(/\s+/, ' ') end it { is_expected.to eq(expected) } end context 'services specified' do subject { described_class.new(view, services: ['vkontakte', 'lj']).to_s } let(:expected) do '
'.gsub(/\s+/, ' ') end it { is_expected.to eq(expected) } end context 'language specified' do subject { described_class.new(view, lang: 'en').to_s } let(:expected) do '
'.gsub(/\s+/, ' ') end it { is_expected.to eq(expected) } end context 'image specified' do subject { described_class.new(view, image: '/img.png').to_s } let(:expected) do '
'.gsub(/\s+/, ' ') end it { is_expected.to eq(expected) } end context 'image specified' do subject { described_class.new(view, type: 'small').to_s } let(:expected) do '
'.gsub(/\s+/, ' ') end it { is_expected.to eq(expected) } end end end