Sha256: 85a166840799595dde1e2f66434bc75b0f02ad0135bb71a40b687763eeaa53bd

Contents?: true

Size: 493 Bytes

Versions: 6

Compression:

Stored size: 493 Bytes

Contents

require 'spec_helper'

describe Slacken::Filters::SanitizeLink, dsl: true do
  describe '#valid?' do
    subject { described_class.new.valid?(component) }

    context 'when a image occurs in a link' do
      let(:component) do
        c(:a, c(:img))
      end

      it { is_expected.to be_falsey }
    end

    context 'when a strong occurs in a link' do
      let(:component) do
        c(:a,  c(:strong, text('content')))
      end

      it { is_expected.to be_truthy }
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
slacken-0.1.6 spec/slacken/filters/sanitize_link_spec.rb
slacken-0.1.5 spec/slacken/filters/sanitize_link_spec.rb
slacken-0.1.4 spec/slacken/filters/sanitize_link_spec.rb
slacken-0.1.3 spec/slacken/filters/sanitize_link_spec.rb
slacken-0.1.2 spec/slacken/filters/sanitize_link_spec.rb
slacken-0.1.1 spec/slacken/filters/sanitize_link_spec.rb