From 8401570aff4b11a1563a08013b38781fd7645195 Mon Sep 17 00:00:00 2001 From: Ologho Cyril Paul Date: Fri, 3 Feb 2017 12:59:43 +0100 Subject: [PATCH] test(user-route): update me route test - update 'me' route test [#137599493] --- spec/controllers/users_controller_spec.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index 69b2a77..bd98b01 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -31,15 +31,12 @@ end describe "#me" do - let(:user) { valid_user } context "when it is a valid request", valid_request: true do it "gets single user information" do - get :me, id: user.id, format: :json - user = User.first - expect(parsed_json['id']).to eq(user.id) - expect(parsed_json['name']).to eq(user.name) - expect(parsed_json['points']).to eq(user.points) - expect(parsed_json['image']).to eq(user.image) + get :me, format: :json + expect(parsed_json['id']).to eq(valid_user.id) + expect(parsed_json['name']).to eq(valid_user.name) + expect(parsed_json['points']).to eq(valid_user.points) end end end