-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#6828 Use json-schema in tests #7419
Conversation
Yes, but I am wondering if we could have some helper to write the schema? |
@ph def, we should dry this up before merging imo. Let me fix the other cases real quick then and see what I can do about that :) |
@ph added the remaining cases that I could at reasonable effort port. Two cases, namely: context "#values" do
let(:payload) { LogStash::Json.load(last_response.body) }
it "return totals of plugins" do
expect(payload["total"]).to eq(payload["plugins"].count)
end
it "return a list of available plugins" do
payload["plugins"].each do |plugin|
expect do
Gem::Specification.find_by_name(plugin["name"])
end.not_to raise_error
end
end seem very hard to port since the schema validation has no comparison logic across fields. |
@ph can you give this another look whenever you find a sec? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, much cleaner.
one step for #6828 :)
@ph this is what you had in mind right? (didn't do all specs yet in case the answer is "no" :))