mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Add test for class_name in EmbedController
This commit is contained in:
parent
b7d16de914
commit
10f2db67ba
@ -108,7 +108,7 @@ describe EmbedController do
|
||||
before do
|
||||
Fabricate(:embeddable_host)
|
||||
Fabricate(:embeddable_host, host: 'http://discourse.org')
|
||||
Fabricate(:embeddable_host, host: 'https://example.com/1234')
|
||||
Fabricate(:embeddable_host, host: 'https://example.com/1234', class_name: 'example')
|
||||
end
|
||||
|
||||
context "success" do
|
||||
@ -130,6 +130,12 @@ describe EmbedController do
|
||||
expect(response).to be_success
|
||||
end
|
||||
|
||||
it "contains custom class name" do
|
||||
controller.request.stubs(:referer).returns("https://example.com/some-other-path")
|
||||
get :comments, embed_url: embed_url
|
||||
expect(assigns(:embeddable_css_class)).to eq(' class="example"')
|
||||
end
|
||||
|
||||
it "doesn't work with a made up host" do
|
||||
controller.request.stubs(:referer).returns("http://codinghorror.com/invalid-url")
|
||||
get :comments, embed_url: embed_url
|
||||
|
Loading…
Reference in New Issue
Block a user