mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-06 01:41:08 +00:00
Share common factory setup
This commit is contained in:
parent
caf29d8ad8
commit
e2d114f00b
|
@ -4,8 +4,9 @@ require 'rails_helper'
|
|||
|
||||
RSpec.describe Admin::DashboardHelper do
|
||||
describe 'relevant_account_timestamp' do
|
||||
let(:account) { Fabricate(:account) }
|
||||
|
||||
context 'with an account with older sign in' do
|
||||
let(:account) { Fabricate(:account) }
|
||||
let(:stamp) { 10.days.ago }
|
||||
|
||||
it 'returns a time element' do
|
||||
|
@ -18,8 +19,6 @@ RSpec.describe Admin::DashboardHelper do
|
|||
end
|
||||
|
||||
context 'with an account with newer sign in' do
|
||||
let(:account) { Fabricate(:account) }
|
||||
|
||||
it 'returns a time element' do
|
||||
account.user.update(current_sign_in_at: 10.hours.ago)
|
||||
result = helper.relevant_account_timestamp(account)
|
||||
|
@ -29,8 +28,6 @@ RSpec.describe Admin::DashboardHelper do
|
|||
end
|
||||
|
||||
context 'with an account where the user is pending' do
|
||||
let(:account) { Fabricate(:account) }
|
||||
|
||||
it 'returns a time element' do
|
||||
account.user.update(current_sign_in_at: nil)
|
||||
account.user.update(approved: false)
|
||||
|
@ -42,7 +39,6 @@ RSpec.describe Admin::DashboardHelper do
|
|||
end
|
||||
|
||||
context 'with an account with a last status value' do
|
||||
let(:account) { Fabricate(:account) }
|
||||
let(:stamp) { 5.minutes.ago }
|
||||
|
||||
it 'returns a time element' do
|
||||
|
@ -56,8 +52,6 @@ RSpec.describe Admin::DashboardHelper do
|
|||
end
|
||||
|
||||
context 'with an account without sign in or last status or pending' do
|
||||
let(:account) { Fabricate(:account) }
|
||||
|
||||
it 'returns a time element' do
|
||||
account.user.update(current_sign_in_at: nil)
|
||||
result = helper.relevant_account_timestamp(account)
|
||||
|
|
Loading…
Reference in New Issue
Block a user