Sha256: a15a7b3fbbe7eb255f6322970c332132de2416ada5f4a4310249eedad3827be0

Contents?: true

Size: 379 Bytes

Versions: 33

Compression:

Stored size: 379 Bytes

Contents

describe AmaLayout::NotificationScrubber do
  describe '#initialize' do
    let(:sanitized) { Loofah.fragment(string).scrub!(subject).to_s }
    let(:string) { '<script>alert("haxxed");</script><a href="#" invalid="test">test</a>waffles' }

    it 'scrubs HTML tags from a string' do
      expect(sanitized).to eq('alert("haxxed");<a href="#">test</a>waffles')
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
ama_layout-11.5.1 spec/ama_layout/notification_scrubber_spec.rb
ama_layout-11.5.0 spec/ama_layout/notification_scrubber_spec.rb
ama_layout-11.4.0 spec/ama_layout/notification_scrubber_spec.rb
ama_layout-11.3.1 spec/ama_layout/notification_scrubber_spec.rb
ama_layout-11.3.0 spec/ama_layout/notification_scrubber_spec.rb
ama_layout-11.2.0 spec/ama_layout/notification_scrubber_spec.rb
ama_layout-11.1.0 spec/ama_layout/notification_scrubber_spec.rb
ama_layout-10.2.0 spec/ama_layout/notification_scrubber_spec.rb
ama_layout-10.1.0 spec/ama_layout/notification_scrubber_spec.rb
ama_layout-10.0.1 spec/ama_layout/notification_scrubber_spec.rb
ama_layout-9.5.3 spec/ama_layout/notification_scrubber_spec.rb
ama_layout-9.5.2 spec/ama_layout/notification_scrubber_spec.rb
ama_layout-9.5.1 spec/ama_layout/notification_scrubber_spec.rb
ama_layout-9.5.0 spec/ama_layout/notification_scrubber_spec.rb
ama_layout-9.4.1 spec/ama_layout/notification_scrubber_spec.rb
ama_layout-9.4.0 spec/ama_layout/notification_scrubber_spec.rb
ama_layout-9.3.0 spec/ama_layout/notification_scrubber_spec.rb
ama_layout-9.2.0 spec/ama_layout/notification_scrubber_spec.rb
ama_layout-9.1.0 spec/ama_layout/notification_scrubber_spec.rb
ama_layout-9.0.0 spec/ama_layout/notification_scrubber_spec.rb