mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
FEATURE: Can edit category/host relationships for embedding
This commit is contained in:
parent
913c3d6f63
commit
d1c69189f3
36 changed files with 449 additions and 127 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue