Skip to content

Commit

Permalink
Render DELETE action for notifications
Browse files Browse the repository at this point in the history
Notifications can be deleted through the DELETE method, yet we don't
render that as an available action when we return notification members
through GET. This is beecause the method has been enabled but no
action has been configured. Configuring a delete action solves this
problem.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1420872
  • Loading branch information
imtayadeway committed Apr 17, 2017
1 parent 7aa1e78 commit 6a87cdc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,8 @@
:post:
- :name: mark_as_seen
- :name: delete
:delete:
- :name: delete
:orchestration_stacks:
:description: Orchestration Stacks
:options:
Expand Down
17 changes: 17 additions & 0 deletions spec/requests/api/notifications_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,23 @@
end
end

describe "notification read" do
it "renders the available actions" do
api_basic_authorize

run_get(notification_url)

expected = {
"actions" => a_collection_including(
a_hash_including("name" => "mark_as_seen", "method" => "post"),
a_hash_including("name" => "delete", "method" => "post"),
a_hash_including("name" => "delete", "method" => "delete")
)
}
expect(response.parsed_body).to include(expected)
end
end

describe 'notification edit' do
it 'is not supported' do
api_basic_authorize
Expand Down

0 comments on commit 6a87cdc

Please sign in to comment.