mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
FEATURE: Can edit category/host relationships for embedding
This commit is contained in:
@ -11,7 +11,6 @@ describe EmbedController do
|
||||
end
|
||||
|
||||
it "raises an error with a missing host" do
|
||||
SiteSetting.embeddable_hosts = nil
|
||||
get :comments, embed_url: embed_url
|
||||
expect(response).not_to be_success
|
||||
end
|
||||
@ -19,7 +18,7 @@ describe EmbedController do
|
||||
context "by topic id" do
|
||||
|
||||
before do
|
||||
SiteSetting.embeddable_hosts = host
|
||||
Fabricate(:embeddable_host)
|
||||
controller.request.stubs(:referer).returns('http://eviltrout.com/some-page')
|
||||
end
|
||||
|
||||
@ -31,9 +30,7 @@ describe EmbedController do
|
||||
end
|
||||
|
||||
context "with a host" do
|
||||
before do
|
||||
SiteSetting.embeddable_hosts = host
|
||||
end
|
||||
let!(:embeddable_host) { Fabricate(:embeddable_host) }
|
||||
|
||||
it "raises an error with no referer" do
|
||||
get :comments, embed_url: embed_url
|
||||
@ -68,7 +65,9 @@ describe EmbedController do
|
||||
|
||||
context "with multiple hosts" do
|
||||
before do
|
||||
SiteSetting.embeddable_hosts = "#{host}\nhttp://discourse.org\nhttps://example.com/1234"
|
||||
Fabricate(:embeddable_host)
|
||||
Fabricate(:embeddable_host, host: 'http://discourse.org')
|
||||
Fabricate(:embeddable_host, host: 'https://example.com/1234')
|
||||
end
|
||||
|
||||
context "success" do
|
||||
|
Reference in New Issue
Block a user