Sha256: 2ad70a740b169719015700e80e2ec432d3d38c3a1957ab668baaff1cc0c5478b

Contents?: true

Size: 770 Bytes

Versions: 10

Compression:

Stored size: 770 Bytes

Contents

# encoding: UTF-8
require "spec_helper"
require 'action_view'

class DummyHelper
  include ::ActionView::Helpers::UrlHelper
  include Flakey::Facebook
end

describe Flakey::Facebook do
  subject { DummyHelper.new }

  describe 'share_button' do
    before { subject.stub_chain('request.url') { 'http://example.com/hello' } }
    let(:default_url) do
      "#{Flakey::Facebook::SHARE_URL}?u=http%3A%2F%2Fexample.com%2Fhello"
    end

    it 'should add the url' do
      subject.share_button.should include(default_url)
    end

    it 'should have a class' do
      subject.share_button.should include('class="facebook-share-but')
    end

    it 'should render a label' do
      subject.share_button(label: 'Grinnick').should include('>Grinnick</a>')
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
flakey-0.8.2 spec/flakey/facebook_spec.rb
flakey-0.8.1 spec/flakey/facebook_spec.rb
flakey-0.8.0 spec/flakey/facebook_spec.rb
flakey-0.7.0 spec/flakey/facebook_spec.rb
flakey-0.6.1 spec/flakey/facebook_spec.rb
flakey-0.6.0 spec/flakey/facebook_spec.rb
flakey-0.5.0 spec/flakey/facebook_spec.rb
flakey-0.4.0 spec/flakey/facebook_spec.rb
flakey-0.3.1 spec/flakey/facebook_spec.rb
flakey-0.3.0 spec/flakey/facebook_spec.rb