Skip to content

Commit

Permalink
api_task_url - pass in whole tasks, not just id
Browse files Browse the repository at this point in the history
  • Loading branch information
himdel committed Dec 5, 2017
1 parent fa77ac0 commit 74b36b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/requests/tasks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def expect_deleted(*args)
it 'deletes on DELETE' do
api_basic_authorize resource_action_identifier(:tasks, :delete, :delete)

delete(api_task_url(nil, task.id))
delete(api_task_url(nil, task))

expect(response).to have_http_status(:no_content) # 204
expect_deleted(task)
Expand All @@ -23,7 +23,7 @@ def expect_deleted(*args)
data = {
:action => 'delete'
}
post(api_task_url(nil, task.id), :params => data)
post(api_task_url(nil, task), :params => data)

expect(response).to have_http_status(:ok) # 200
expect_deleted(task)
Expand All @@ -41,8 +41,8 @@ def expect_deleted(*args)
data = {
:action => 'delete',
:resources => [
{:href => api_task_url(nil, task.id)},
{:href => api_task_url(nil, task2.id)}
{:href => api_task_url(nil, task)},
{:href => api_task_url(nil, task2)}
]
}
post(api_tasks_url, :params => data)
Expand Down

0 comments on commit 74b36b6

Please sign in to comment.