mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 11:52:45 +08:00
DEV: Fix failling test.
This commit is contained in:
parent
2adbec1b3c
commit
4696be4c19
|
@ -6,14 +6,14 @@ describe ClicksController do
|
||||||
|
|
||||||
let(:url) { "https://discourse.org/" }
|
let(:url) { "https://discourse.org/" }
|
||||||
let(:headers) { { REMOTE_ADDR: "192.168.0.1" } }
|
let(:headers) { { REMOTE_ADDR: "192.168.0.1" } }
|
||||||
let(:post) { create_post(raw: "this is a post with a link #{url}") }
|
let(:post_with_url) { create_post(raw: "this is a post with a link #{url}") }
|
||||||
|
|
||||||
context '#track' do
|
context '#track' do
|
||||||
it "creates a TopicLinkClick" do
|
it "creates a TopicLinkClick" do
|
||||||
sign_in(Fabricate(:user))
|
sign_in(Fabricate(:user))
|
||||||
|
|
||||||
expect {
|
expect {
|
||||||
post "/clicks/track", params: { url: url, post_id: post.id, topic_id: post.topic_id }, headers: headers
|
post "/clicks/track", params: { url: url, post_id: post_with_url.id, topic_id: post_with_url.topic_id }, headers: headers
|
||||||
}.to change { TopicLinkClick.count }.by(1)
|
}.to change { TopicLinkClick.count }.by(1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user