From 4696be4c19355feeef2ac30f626fba65e6d87887 Mon Sep 17 00:00:00 2001 From: Bianca Nenciu Date: Tue, 7 May 2019 11:19:13 +0300 Subject: [PATCH] DEV: Fix failling test. --- spec/requests/clicks_controller_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/requests/clicks_controller_spec.rb b/spec/requests/clicks_controller_spec.rb index 208be2edaf4..796f358b5de 100644 --- a/spec/requests/clicks_controller_spec.rb +++ b/spec/requests/clicks_controller_spec.rb @@ -6,14 +6,14 @@ describe ClicksController do let(:url) { "https://discourse.org/" } 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 it "creates a TopicLinkClick" do sign_in(Fabricate(:user)) 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) end end