mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 14:11:16 +08:00
Make embedded comments look nicer
This commit is contained in:
@ -6,13 +6,13 @@ describe EmbedController do
|
||||
let(:embed_url) { "http://eviltrout.com/2013/02/10/why-discourse-uses-emberjs.html" }
|
||||
|
||||
it "is 404 without an embed_url" do
|
||||
get :best
|
||||
get :comments
|
||||
response.should_not be_success
|
||||
end
|
||||
|
||||
it "raises an error with a missing host" do
|
||||
SiteSetting.stubs(:embeddable_host).returns(nil)
|
||||
get :best, embed_url: embed_url
|
||||
get :comments, embed_url: embed_url
|
||||
response.should_not be_success
|
||||
end
|
||||
|
||||
@ -22,7 +22,7 @@ describe EmbedController do
|
||||
end
|
||||
|
||||
it "raises an error with no referer" do
|
||||
get :best, embed_url: embed_url
|
||||
get :comments, embed_url: embed_url
|
||||
response.should_not be_success
|
||||
end
|
||||
|
||||
@ -42,13 +42,13 @@ describe EmbedController do
|
||||
retriever = mock
|
||||
TopicRetriever.expects(:new).returns(retriever)
|
||||
retriever.expects(:retrieve)
|
||||
get :best, embed_url: embed_url
|
||||
get :comments, embed_url: embed_url
|
||||
end
|
||||
|
||||
it "creates a topic view when a topic_id is found" do
|
||||
TopicEmbed.expects(:topic_id_for_embed).returns(123)
|
||||
TopicView.expects(:new).with(123, nil, {best: 5})
|
||||
get :best, embed_url: embed_url
|
||||
TopicView.expects(:new).with(123, nil, {limit: 100, exclude_first: true})
|
||||
get :comments, embed_url: embed_url
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user