闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
619 B

  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe InlineRablScope do
  4. describe '#current_account' do
  5. it 'returns the given account' do
  6. account = Fabricate(:account)
  7. expect(InlineRablScope.new(account).current_account).to eq account
  8. end
  9. end
  10. describe '#current_user' do
  11. it 'returns nil if the given account is nil' do
  12. expect(InlineRablScope.new(nil).current_user).to eq nil
  13. end
  14. it 'returns user of account if the given account is not nil' do
  15. user = Fabricate(:user)
  16. expect(InlineRablScope.new(user.account).current_user).to eq user
  17. end
  18. end
  19. end