More controller specs (#2561)
* Add render_views in more places * Delegate methods from account to user with allow nil true, so that admin accounts show view renders when missing a user * Use actual account instances in authorize follow controller spec
This commit is contained in:
parent
0e2589867f
commit
9566893cc9
24 changed files with 53 additions and 7 deletions
|
@ -3,6 +3,8 @@
|
|||
require 'rails_helper'
|
||||
|
||||
describe AuthorizeFollowsController do
|
||||
render_views
|
||||
|
||||
describe 'GET #show' do
|
||||
describe 'when signed out' do
|
||||
it 'redirects to sign in page' do
|
||||
|
@ -38,7 +40,7 @@ describe AuthorizeFollowsController do
|
|||
end
|
||||
|
||||
it 'sets account from url' do
|
||||
account = double
|
||||
account = Account.new
|
||||
service = double
|
||||
allow(FetchRemoteAccountService).to receive(:new).and_return(service)
|
||||
allow(service).to receive(:call).with('http://example.com').and_return(account)
|
||||
|
@ -50,7 +52,7 @@ describe AuthorizeFollowsController do
|
|||
end
|
||||
|
||||
it 'sets account from acct uri' do
|
||||
account = double
|
||||
account = Account.new
|
||||
service = double
|
||||
allow(FollowRemoteAccountService).to receive(:new).and_return(service)
|
||||
allow(service).to receive(:call).with('found@hostname').and_return(account)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue