about summary refs log tree commit diff
path: root/spec/controllers/api/v1/accounts_controller_spec.rb
diff options
context:
space:
mode:
authorJack Jennings <jack@standard-library.com>2017-05-19 15:27:13 -0700
committerEugen Rochko <eugen@zeonfederated.com>2017-05-20 00:27:13 +0200
commit8c5eaf7ae9f78fa6bb8b2d999b36862484d12656 (patch)
tree70f4d482aa62f3270171edc4134e433d667ac627 /spec/controllers/api/v1/accounts_controller_spec.rb
parent7eb8b2efad3898f9cc28d942a34e5e483ead5193 (diff)
Enable and fill in JSON response test in API::AccountsController (#3157)
Diffstat (limited to 'spec/controllers/api/v1/accounts_controller_spec.rb')
-rw-r--r--spec/controllers/api/v1/accounts_controller_spec.rb19
1 files changed, 17 insertions, 2 deletions
diff --git a/spec/controllers/api/v1/accounts_controller_spec.rb b/spec/controllers/api/v1/accounts_controller_spec.rb
index 041b279f7..dec81aff5 100644
--- a/spec/controllers/api/v1/accounts_controller_spec.rb
+++ b/spec/controllers/api/v1/accounts_controller_spec.rb
@@ -234,8 +234,23 @@ RSpec.describe Api::V1::AccountsController, type: :controller do
         expect(response).to have_http_status(:success)
       end
 
-      xit 'returns JSON with correct data' do
-        # todo
+      it 'returns JSON with correct data' do
+        json = body_as_json
+
+        expect(json).to be_a Enumerable
+        expect(json.first[:id]).to be simon.id
+        expect(json.first[:following]).to be true
+        expect(json.first[:followed_by]).to be false
+        expect(json.first[:muting]).to be false
+        expect(json.first[:requested]).to be false
+        expect(json.first[:domain_blocking]).to be false
+
+        expect(json.second[:id]).to be lewis.id
+        expect(json.second[:following]).to be false
+        expect(json.second[:followed_by]).to be true
+        expect(json.second[:muting]).to be false
+        expect(json.second[:requested]).to be false
+        expect(json.second[:domain_blocking]).to be false
       end
     end
   end