]> cat aescling's git repositories - mastodon.git/commitdiff
Spec AuthorizeFollowsController assigns @account (#3246)
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
Tue, 23 May 2017 11:12:45 +0000 (20:12 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Tue, 23 May 2017 11:12:45 +0000 (13:12 +0200)
@account is used by the view.

spec/controllers/authorize_follows_controller_spec.rb

index 87a46cf8eea208078b7270216971437b2d57182d..1bc4eb6b776f3de67b0433384e9592803ddc591e 100644 (file)
@@ -48,7 +48,7 @@ describe AuthorizeFollowsController do
         get :show, params: { acct: 'http://example.com' }
 
         expect(response).to have_http_status(:success)
-        expect(service).to have_received(:call).with('http://example.com')
+        expect(assigns(:account)).to eq account
       end
 
       it 'sets account from acct uri' do
@@ -60,7 +60,7 @@ describe AuthorizeFollowsController do
         get :show, params: { acct: 'acct:found@hostname' }
 
         expect(response).to have_http_status(:success)
-        expect(service).to have_received(:call).with('found@hostname')
+        expect(assigns(:account)).to eq account
       end
     end
   end