mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 08:13:44 +08:00
c9dab6fd08
It's very easy to forget to add `require 'rails_helper'` at the top of every core/plugin spec file, and omissions can cause some very confusing/sporadic errors. By setting this flag in `.rspec`, we can remove the need for `require 'rails_helper'` entirely.
18 lines
504 B
Ruby
18 lines
504 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "onebox/oembed"
|
|
|
|
describe Onebox::Oembed do
|
|
it "excludes html tags" do
|
|
json = '{"text": "<iframe src=\'https://ifram.es/foo/bar\'></iframe>"}'
|
|
oembed = described_class.new(json)
|
|
expect(oembed.text).to be_nil
|
|
end
|
|
|
|
it "includes html tags" do
|
|
json = '{"html": "<iframe src=\'https://ifram.es/foo/bar\'></iframe>"}'
|
|
oembed = described_class.new(json)
|
|
expect(oembed.html).to eq("<iframe src='https://ifram.es/foo/bar'></iframe>")
|
|
end
|
|
end
|