1
0
mirror of https://github.com/funamitech/mastodon synced 2024-12-11 21:29:17 +09:00
YuruToot/spec/lib/inline_rabl_scope_spec.rb
Akihiko Odaki (@fn_aki@pawoo.net) 02a0fd5b64 Spec InlineRablScope (#3542)
2017-06-04 15:00:08 +02:00

24 lines
619 B
Ruby

# frozen_string_literal: true
require 'rails_helper'
describe InlineRablScope do
describe '#current_account' do
it 'returns the given account' do
account = Fabricate(:account)
expect(InlineRablScope.new(account).current_account).to eq account
end
end
describe '#current_user' do
it 'returns nil if the given account is nil' do
expect(InlineRablScope.new(nil).current_user).to eq nil
end
it 'returns user of account if the given account is not nil' do
user = Fabricate(:user)
expect(InlineRablScope.new(user.account).current_user).to eq user
end
end
end