From 12e4dd59b75d4571c708c4cedbb61af58e5e107b Mon Sep 17 00:00:00 2001 From: riking Date: Mon, 21 May 2018 18:04:54 -0700 Subject: [PATCH] Style fix for test --- spec/models/user_profile_view_spec.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spec/models/user_profile_view_spec.rb b/spec/models/user_profile_view_spec.rb index 108a5a7a5f..75c235a3b2 100644 --- a/spec/models/user_profile_view_spec.rb +++ b/spec/models/user_profile_view_spec.rb @@ -28,14 +28,13 @@ RSpec.describe UserProfileView do end end - it "should not create duplicated profile view for signed in user" do + it "should not create duplicated profile view or log IP for signed in user" do time = Time.zone.now ['1.1.1.1', '2.2.2.2'].each do |ip| add(user_profile_id, ip, other_user.id, time) expect(described_class.count).to eq(1) - # should not actually log IPs - expect(UserProfileView.where(user_id: other_user.id).count(:ip_address)).to eq(0) + expect(UserProfileView.find_by(user_id: other_user.id).ip_address).to eq(nil) end end