FEATURE: Can edit category/host relationships for embedding

This commit is contained in:
Robin Ward
2015-08-18 17:15:46 -04:00
parent 913c3d6f63
commit d1c69189f3
36 changed files with 449 additions and 127 deletions

View File

@ -4,36 +4,6 @@ require_dependency 'site_setting_extension'
describe SiteSetting do
describe "allows_embeddable_host" do
it 'works as expected' do
SiteSetting.embeddable_hosts = 'eviltrout.com'
expect(SiteSetting.allows_embeddable_host?('http://eviltrout.com')).to eq(true)
expect(SiteSetting.allows_embeddable_host?('https://eviltrout.com')).to eq(true)
expect(SiteSetting.allows_embeddable_host?('https://not-eviltrout.com')).to eq(false)
end
it 'works with a http host' do
SiteSetting.embeddable_hosts = 'http://eviltrout.com'
expect(SiteSetting.allows_embeddable_host?('http://eviltrout.com')).to eq(true)
expect(SiteSetting.allows_embeddable_host?('https://eviltrout.com')).to eq(true)
expect(SiteSetting.allows_embeddable_host?('https://not-eviltrout.com')).to eq(false)
end
it 'works with a https host' do
SiteSetting.embeddable_hosts = 'https://eviltrout.com'
expect(SiteSetting.allows_embeddable_host?('http://eviltrout.com')).to eq(true)
expect(SiteSetting.allows_embeddable_host?('https://eviltrout.com')).to eq(true)
expect(SiteSetting.allows_embeddable_host?('https://not-eviltrout.com')).to eq(false)
end
it 'works with multiple hosts' do
SiteSetting.embeddable_hosts = "https://eviltrout.com\nhttps://discourse.org"
expect(SiteSetting.allows_embeddable_host?('http://eviltrout.com')).to eq(true)
expect(SiteSetting.allows_embeddable_host?('http://discourse.org')).to eq(true)
end
end
describe 'topic_title_length' do
it 'returns a range of min/max topic title length' do
expect(SiteSetting.topic_title_length).to eq(