Time off request model

Yeah, that's why I was using `@compar_attrs`.  Reference how I do this for
shifts api

On Mon, Oct 6, 2014 at 10:18 AM, Michael Pierce <notifications@github.com>
wrote:

> In spec/controllers/scheduling/time_off_requests_controller_spec.rb:
>
> >          put :update, id: @time_off_request, time_off_request: FactoryGirl.attributes_for(:time_off_request)
> > -        response.should redirect_to @time_off_request
> > +
> > +        JSON.parse(response.body).slice(*@compare_attrs).should ==
>
> Getting this weird error: Failure/Error: JSON.parse(response.body).should
> == TimeOffRequest.last.attributes
> expected: {"id"=>204, "user_id"=>1, "starts_at"=>Mon, 06 Oct 2014 16:10:34
> UTC +00:00, "ends_at"=>Mon, 06 Oct 2014 21:10:34 UTC +00:00, "reason"=>"I
> want to have some time off this weekend.", "approved_by_user_id"=>nil,
> "approved_at"=>nil, "created_at"=>Mon, 06 Oct 2014 16:12:20 UTC +00:00,
> "updated_at"=>Mon, 06 Oct 2014 16:12:20 UTC +00:00, "active"=>true,
> "approved"=>false, "location_id"=>nil, "processed_by_last_name"=>nil,
> "processed_by_first_name"=>nil, "all_day"=>nil}
> got: {"id"=>204, "user_id"=>1,
> "starts_at"=>"2014-10-06T10:10:34.000-06:00",
> "ends_at"=>"2014-10-06T15:10:34.000-06:00", "reason"=>"I want to have some
> time off this weekend.", "approved_by_user_id"=>nil, "approved_at"=>nil,
> "created_at"=>"2014-10-06T10:12:20.000-06:00",
> "updated_at"=>"2014-10-06T10:12:20.279-06:00", "active"=>true,
> "approved"=>false, "location_id"=>nil, "processed_by_last_name"=>nil,
> "processed_by_first_name"=>nil, "all_day"=>nil} (using ==)
> Diff:
>
>    @@ -3,14 +3,14 @@
>     "approved" => false,
>     "approved_at" => nil,
>     "approved_by_user_id" => nil,
>    -"created_at" => Mon, 06 Oct 2014 16:12:20 UTC +00:00,
>    -"ends_at" => Mon, 06 Oct 2014 21:10:34 UTC +00:00,
>    +"created_at" => "2014-10-06T10:12:20.000-06:00",
>    +"ends_at" => "2014-10-06T15:10:34.000-06:00",
>     "id" => 204,
>     "location_id" => nil,
>     "processed_by_first_name" => nil,
>     "processed_by_last_name" => nil,
>     "reason" => "I want to have some time off this weekend.",
>    -"starts_at" => Mon, 06 Oct 2014 16:10:34 UTC +00:00,
>    -"updated_at" => Mon, 06 Oct 2014 16:12:20 UTC +00:00,
>    +"starts_at" => "2014-10-06T10:10:34.000-06:00",
>    +"updated_at" => "2014-10-06T10:12:20.279-06:00",
>     "user_id" => 1
>  # ./spec/controllers/scheduling/time_off_requests_controller_spec.rb:105:in `block (4 levels) in <top (required)>'
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/affektive/digiquatics/pull/1208/files#r18466704>.
>