Skip to content

Commit

Permalink
updating update message
Browse files Browse the repository at this point in the history
  • Loading branch information
Jillian Tullo committed Mar 16, 2017
1 parent a36e29d commit 7197086
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/controllers/api/authentications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ module Api
class AuthenticationsController < BaseController
def edit_resource(type, id, data)
auth = resource_search(id, type, collection_class(:authentications))
raise 'type not currently supported' unless auth.respond_to?(:update_in_provider_queue)
raise "Update not supported for #{authentication_ident(auth)}" unless auth.respond_to?(:update_in_provider_queue)
task_id = auth.update_in_provider_queue(data)
action_result(true, "Updating Authentication with id #{id}", :task_id => task_id)
action_result(true, "Updating #{authentication_ident(auth)}", :task_id => task_id)
rescue => err
action_result(false, err.to_s)
end
Expand Down
10 changes: 5 additions & 5 deletions spec/requests/api/authentications_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
'results' => [
a_hash_including(
'success' => true,
'message' => "Updating Authentication with id #{auth.id}",
'message' => a_string_including('Updating Authentication'),
'task_id' => a_kind_of(Numeric)
)
]
Expand All @@ -155,12 +155,12 @@
'results' => [
a_hash_including(
'success' => true,
'message' => "Updating Authentication with id #{auth.id}",
'message' => a_string_including('Updating Authentication'),
'task_id' => a_kind_of(Numeric)
),
a_hash_including(
'success' => true,
'message' => "Updating Authentication with id #{auth_2.id}",
'message' => a_string_including('Updating Authentication'),
'task_id' => a_kind_of(Numeric)
)
]
Expand Down Expand Up @@ -215,7 +215,7 @@

expected = {
'success' => true,
'message' => "Updating Authentication with id #{auth.id}",
'message' => a_string_including('Updating Authentication'),
'task_id' => a_kind_of(Numeric)
}
expect(response).to have_http_status(:ok)
Expand All @@ -230,7 +230,7 @@

expected = {
'success' => false,
'message' => 'type not currently supported'
'message' => "Update not supported for Authentication id:#{auth.id} name: '#{auth.name}'"
}
expect(response).to have_http_status(:ok)
expect(response.parsed_body).to include(expected)
Expand Down

0 comments on commit 7197086

Please sign in to comment.