Skip to content

Commit

Permalink
Update test syntax for Rails 5
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekEdwards committed Jun 8, 2018
1 parent b41956e commit c4b8fb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/controllers/assets_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_policy

it 'GET edit_depreciation' do
test_asset.update!(:organization => subject.current_user.organization)
get :edit_depreciation, :id => test_asset.object_key, use_route: :edit_depreciation_inventory_path
get :edit_depreciation, params: {:id => test_asset.object_key, use_route: :edit_depreciation_inventory_path}

expect(assigns(:asset)).to eq(Asset.get_typed_asset(test_asset))
expect(assigns(:proxy).object_key).to eq(test_asset.object_key)
Expand All @@ -39,7 +39,7 @@ def get_policy
# update required fields for a vehicle
test_asset.update!(:depreciable => false, :manufacturer_id => 1, :manufacturer_model => 'VERSION-XX', :title_owner_organization_id => 1,:fta_ownership_type_id => 1, :fta_vehicle_type_id => 1, :fuel_type_id => 1, :serial_number => 'XXX-123456789', :vehicle_length => 40)

post :update_depreciation, use_route: :update_depreciation_inventory_path, :asset_depreciable_proxy => {:object_key => test_asset.object_key, :depreciable => '1', :depreciation_start_date => (Date.today - 1.day).strftime('%m/%d/%Y'), :salvage_value => '1111'}
post :update_depreciation, params: { use_route: :update_depreciation_inventory_path, :asset_depreciable_proxy => {:object_key => test_asset.object_key, :depreciable => '1', :depreciation_start_date => (Date.today - 1.day).strftime('%m/%d/%Y'), :salvage_value => '1111'}}
test_asset.reload

expect(test_asset.depreciable).to be true
Expand Down

0 comments on commit c4b8fb2

Please sign in to comment.