DEV: Fix failling test.

This commit is contained in:
Bianca Nenciu 2019-05-07 11:19:13 +03:00
parent 2adbec1b3c
commit 4696be4c19

View File

@ -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