Skip to content

Commit

Permalink
spec to test v_class attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
AparnaKarve committed Jan 12, 2017
1 parent 891fe83 commit d674956
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spec/requests/api/requests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,17 @@
request.add_tag(t.name, t.children.first.name)

api_basic_authorize action_identifier(:requests, :read, :resource_actions, :get)
run_get requests_url(request.id), :attributes => "workflow,v_allowed_tags"
run_get requests_url(request.id), :attributes => "workflow,v_allowed_tags,v_class"

expected_workflow = a_hash_including("id" => request.id, "workflow" => a_hash_including("values"))
expected_tags = a_hash_including("id" => request.id, "v_allowed_tags" => [a_hash_including("children")])
expected_class = a_hash_including(
"id" => request.id,
"v_class" => {"instance_logger" => a_hash_including("klass" => request.workflow.class.to_s)})

expect(response.parsed_body).to match(expected_workflow)
expect(response.parsed_body).to match(expected_tags)
expect(response.parsed_body).to match(expected_class)
expect(response).to have_http_status(:ok)
end
end
Expand Down

0 comments on commit d674956

Please sign in to comment.