mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 12:02:05 +08:00
DEV: Use proper wording for contexts in specs
This commit is contained in:

committed by
Loïc Guitaut

parent
02987e05d5
commit
3eaac56797
@ -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)
|
||||
|
Reference in New Issue
Block a user