Count users that only answer questions as active
This commit is contained in:
parent
c1cf9bab3f
commit
a768d09862
|
@ -22,7 +22,6 @@ class StaticController < ApplicationController
|
||||||
.where(permanently_banned: false)
|
.where(permanently_banned: false)
|
||||||
.where(banned_until: nil)
|
.where(banned_until: nil)
|
||||||
.where('answered_count > 0')
|
.where('answered_count > 0')
|
||||||
.where('asked_count > 0')
|
|
||||||
.count
|
.count
|
||||||
|
|
||||||
@questions = Question.count
|
@questions = Question.count
|
||||||
|
|
|
@ -7,7 +7,7 @@ describe StaticController, type: :controller do
|
||||||
subject { get :about }
|
subject { get :about }
|
||||||
|
|
||||||
before(:each) {
|
before(:each) {
|
||||||
FactoryBot.create(:user, { confirmed_at: Time.now, answered_count: 1, asked_count: 1 })
|
FactoryBot.create(:user, { confirmed_at: Time.now, answered_count: 1 })
|
||||||
FactoryBot.create(:user, { permanently_banned: true })
|
FactoryBot.create(:user, { permanently_banned: true })
|
||||||
FactoryBot.create(:user, { banned_until: Time.now + 10.days })
|
FactoryBot.create(:user, { banned_until: Time.now + 10.days })
|
||||||
FactoryBot.create(:user, { confirmed_at: Time.now })
|
FactoryBot.create(:user, { confirmed_at: Time.now })
|
||||||
|
|
Loading…
Reference in New Issue