DEV: Use proper wording for contexts in specs

This commit is contained in:
Loïc Guitaut
2022-07-27 18:14:14 +02:00
committed by Loïc Guitaut
parent 02987e05d5
commit 3eaac56797
337 changed files with 2172 additions and 2723 deletions

View File

@ -1,7 +1,6 @@
# frozen_string_literal: true
RSpec.describe UserStat do
it "is created automatically when a user is created" do
user = Fabricate(:evil_trout)
expect(user.user_stat).to be_present
@ -11,11 +10,10 @@ RSpec.describe UserStat do
end
describe '#update_view_counts' do
let(:user) { Fabricate(:user) }
let(:stat) { user.user_stat }
context 'topics_entered' do
context 'with topics_entered' do
context 'without any views' do
it "doesn't increase the user's topics_entered" do
expect { UserStat.update_view_counts; stat.reload }.not_to change(stat, :topics_entered)
@ -42,11 +40,10 @@ RSpec.describe UserStat do
stat.reload
expect(stat.topics_entered).to eq(1)
end
end
end
context 'posts_read_count' do
context 'with posts_read_count' do
context 'without any post timings' do
it "doesn't increase the user's posts_read_count" do
expect { UserStat.update_view_counts; stat.reload }.not_to change(stat, :posts_read_count)