Use chartkick globally
* Clean up legacy charting imports * Update existing donut and line charts * Create helpers for parsing out existing chart data * Move chart partials to a more common path
This commit is contained in:
parent
3bbac3667f
commit
516e53d9df
29 changed files with 331 additions and 577 deletions
|
|
@ -99,6 +99,23 @@ describe User do
|
|||
expect(User.comment_notifiable(conference)).not_to include(user)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'user distribution scopes' do
|
||||
it 'scopes active users' do
|
||||
create(:user, last_sign_in_at: Date.today - 3.months + 1.day) # active
|
||||
expect(User.active.count).to eq(1)
|
||||
end
|
||||
|
||||
it 'scopes unconfirmed users' do
|
||||
create(:user, confirmed_at: nil) # unconfirmed
|
||||
expect(User.unconfirmed.count).to eq(1)
|
||||
end
|
||||
|
||||
it 'scopes dead users' do
|
||||
create(:user, last_sign_in_at: Time.zone.now - 1.year - 1.day) # dead
|
||||
expect(User.dead.count).to eq(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'methods' do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue