From 7378a7d839d80a48dcd031fd1ee7e6128d78b6e2 Mon Sep 17 00:00:00 2001 From: Matt Didier Date: Wed, 28 May 2014 10:48:51 -0500 Subject: [PATCH] updated phones controller spec --- coverage/.last_run.json | 2 +- coverage/.resultset.json | 584 ++------------------- spec/controllers/phones_controller_spec.rb | 7 +- 3 files changed, 62 insertions(+), 531 deletions(-) diff --git a/coverage/.last_run.json b/coverage/.last_run.json index af1ec72..7124eb3 100644 --- a/coverage/.last_run.json +++ b/coverage/.last_run.json @@ -1,5 +1,5 @@ { "result": { - "covered_percent": 75.07 + "covered_percent": 45.76 } } diff --git a/coverage/.resultset.json b/coverage/.resultset.json index 0ebd534..37c2e22 100644 --- a/coverage/.resultset.json +++ b/coverage/.resultset.json @@ -4,7 +4,7 @@ "/Users/mdidier/Desktop/Ping/spec/support/integration_spec_helper.rb": [ 1, 1, - 1, + 0, null, null, null, @@ -60,34 +60,34 @@ 1, null, 1, + 1, + 1, + 1, null, + 1, + 1, + 1, null, + 1, null, null, + 1, + 0, null, null, + 1, + 0, null, null, + 1, + 0, null, null, null, null, null, null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, + 1, null, null, null, @@ -310,187 +310,90 @@ 1, null, 1, - 3, + 0, null, null, 1, - 3, - 2, + 0, + 0, null, null, null, 1, null ], - "/Users/mdidier/Desktop/Ping/spec/controllers/pingas_controller_spec.rb": [ + "/Users/mdidier/Desktop/Ping/app/models/user.rb": [ 1, - null, 1, 1, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "/Users/mdidier/Desktop/Ping/app/controllers/pingas_controller.rb": [ 1, - null, 1, 1, + null, 1, 1, null, - 0, null, 1, 1, 1, 1, - 1, - 1, - 1, - 1, - 1, - null, - null, - 1, 0, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, + 0, null, null, null, null, 1, 0, - 0, - 0, - null, - null, - null, - null, null, null, + 1, 0, - null, 0, - null, - null, - null, - 1, - null, - 1, 0, - null, - null, - null, - null, - 1, 0, 0, 0, 0, - null, - null, - null, - null, - null, - null, - null, - null, 0, null, null, null, + 1, 0, 0, 0, null, null, null, + 1, + 2, null, null, - null, - null, - null, - 0, - null, - null, - 0, - null - ], - "/Users/mdidier/Desktop/Ping/spec/controllers/users_controller_spec.rb": [ 1, + 2, + null, null, - 1, - null - ], - "/Users/mdidier/Desktop/Ping/app/controllers/users_controller.rb": [ 1, 1, - 0, - 0, - 0, - 0, null, - 0, - 0, null, + 1, 0, - 0, - 0, - 0, - 0, - 0, - null, - null, null, null, - null, - null, - null, - 1, - 1, 1, 0, 0, null, + 0, null, null, - null, - null, - null, - null, + 1, null, 0, - null, + 0, null, null, 1, @@ -499,467 +402,94 @@ null, null, null, - null, - null, - null, - null, - null, + 1, + 0, 0, null, null, - 1, null, - null - ], - "/Users/mdidier/Desktop/Ping/spec/features/user_spec.rb": [ 1, + 0, null, - 1, null, 1, - 1, - 1, + 0, null, null, 1, - 1, - 1, - 1, - 1, + 0, null, null ], - "/Users/mdidier/Desktop/Ping/spec/helpers/phones_helper_spec.rb": [ + "/Users/mdidier/Desktop/Ping/app/models/user_category.rb": [ 1, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, 1, 1, null ], - "/Users/mdidier/Desktop/Ping/spec/helpers/users_helper_spec.rb": [ + "/Users/mdidier/Desktop/Ping/app/models/category.rb": [ 1, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, 1, 1, - null - ], - "/Users/mdidier/Desktop/Ping/spec/models/category_spec.rb": [ 1, null, 1, - 1, - 2, - 2, - 2, - null, - null, null ], - "/Users/mdidier/Desktop/Ping/app/models/category.rb": [ - 1, - 1, + "/Users/mdidier/Desktop/Ping/app/models/pinga.rb": [ 1, 1, - null, 1, - null - ], - "/Users/mdidier/Desktop/Ping/spec/models/pinga_spec.rb": [ 1, - null, 1, - 2, - 2, - 2, null, - 10, - 10, - 10, null, 1, - 1, - 1, null, null, 1, 1, 1, null, - null, - 1, 1, - 3, - 3, - null, + 0, + 0, null, + 0, null, - 1, - 1, - 1, + 0, + 0, null, null, 1, - 1, - 1, - 1, + 0, + 0, null, null, 1, + null, 1, - 1, + 0, null, null, - null - ], - "/Users/mdidier/Desktop/Ping/app/models/pinga.rb": [ - 1, - 1, - 1, - 1, 1, + 0, null, + 0, + 0, + 0, + 0, + 0, + 0, null, - 1, + 0, null, null, - 1, - 1, - 1, null, - 1, - 2, - 1, - null, - 1, - null, - 2, - 2, - null, - null, - 1, - 0, - 0, - null, - null, - 1, - null, - 1, - 59, - null, - null, - 1, - 53, - null, - 53, - 10, - 43, - 21, - 22, - 22, - null, - 0, - null, - null, - null, - null, - null - ], - "/Users/mdidier/Desktop/Ping/spec/models/user_category_spec.rb": [ - 1, - null, - 1, - 1, - null - ], - "/Users/mdidier/Desktop/Ping/app/models/user_category.rb": [ - 1, - 1, - 1, - null - ], - "/Users/mdidier/Desktop/Ping/spec/models/user_pinga_spec.rb": [ - 1, - null, - 1, - 5, - 2, - 2, - null, - 1, - 1, - 1, - null, - null, - 1, - 1, - 1, - null, - null, - 1, - 1, - 1, - null, - 1, - 2, - 2, - null, - null, - null, - 1, - 1, - 1, - null, - 1, - 2, - 2, - null, - null, - null, - null - ], - "/Users/mdidier/Desktop/Ping/app/models/user_pinga.rb": [ - 1, - 1, - 1, - null, - 1, - 1, - 1, - 1, - null - ], - "/Users/mdidier/Desktop/Ping/spec/models/user_spec.rb": [ - 1, - null, - 1, - 12, - 12, - 12, - 12, - null, - 1, - 2, - 2, - 2, - 2, - 2, - null, - null, - 1, - 1, - 1, - null, - null, - null, - 1, - 1, - 1, - null, - null, - null, - 1, - 1, - 1, - null, - null, - null, - 1, - 1, - 1, - null, - null, - null, - 1, - 1, - null, - null, - null, - null, - null, - null, - 1, - 1, - null, - null, - null, - 1, - 1, - 1, - null, - null, - null, - null - ], - "/Users/mdidier/Desktop/Ping/app/models/user.rb": [ - 1, - 1, - 1, - 1, - 1, - 1, - null, - 1, - 1, - null, - null, - 1, - 13, - 13, - 13, - 0, - 0, - null, - null, - null, - null, - 1, - 1, - null, - null, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - null, - null, - null, - 1, - 1, - 1, - 1, - null, - null, - null, - 1, - 4, - null, - null, - 1, - 4, - null, - null, - 1, - 2, - null, - null, - 1, - 1, - null, - null, - 1, - 2, - 2, - null, - 2, - null, - null, - 1, - null, - 0, - 1, - null, - null, - 1, - 1, - 0, - null, - null, - null, - 1, - 1, - 0, - null, - null, - null, - 1, - 1, - null, - null, - 1, - 1, - null, - null, - 1, - 1, - null, - null - ], - "/Users/mdidier/Desktop/Ping/spec/views/pingas_controller/create.html.erb_spec.rb": [ - 1, - null, - 1, - 1, - null - ], - "/Users/mdidier/Desktop/Ping/spec/views/pingas_controller/index.html.erb_spec.rb": [ - 1, - null, - 1, - 1, - null - ], - "/Users/mdidier/Desktop/Ping/spec/views/pingas_controller/new.html.erb_spec.rb": [ - 1, - null, - 1, - 1, - null - ], - "/Users/mdidier/Desktop/Ping/spec/views/pingas_controller/show.html.erb_spec.rb": [ - 1, - null, - 1, - 1, - null - ], - "/Users/mdidier/Desktop/Ping/app/controllers/sessions_controller.rb": [ - 1, - 1, - null, - 1, - null, - null, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - null, - null, - 1, - 0, - 0, null, null ] }, - "timestamp": 1401287239 + "timestamp": 1401291724 } } diff --git a/spec/controllers/phones_controller_spec.rb b/spec/controllers/phones_controller_spec.rb index 3e9234e..0a83248 100644 --- a/spec/controllers/phones_controller_spec.rb +++ b/spec/controllers/phones_controller_spec.rb @@ -5,9 +5,10 @@ context "receive request get events" do it "does something with phone" do - data = {data: {uid: 1, oauth_expires_at: Time.now, oauth_token: 1, name: "name", provider: "facebook" }} - get(:recieve_request_get_events, data) - response.status.should eq 200 + data = {data: {uid: "1", oauth_expires_at: Time.now, oauth_token: 1, name: "name", provider: "facebook", latitude: 41.8876, longitude: -87.6368 }} + get(:recieve_request_get_events, data.merge(format: :json)) + pinga_hash = {"pingas_active_in_radius"=>[], "pingas_pending_in_radius"=>[], "pingas_outside_radius"=>[]} + expect(JSON.parse(response.body)).to include(pinga_hash) end end