-
Notifications
You must be signed in to change notification settings - Fork 14
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
add test for first query #92
Conversation
names = result.collect {|x| x["name"]} | ||
|
||
assert names.detect { |e| e == 'FirstEvent' } | ||
assert names.detect { |e| e == 'AnotherEvent' } |
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.
Is assert provided by RSpec? It looks like a minitest assertion.
It would be nice to use RSpec expectations here.
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.
We tried using expect(array_one).to match(array_two)
and assert array_one =~ array_two
plus a couple more but they were just not working, so Matt made a this work around, I guess we will be looking into it more. Maybe they don't work easy with GQL? not sure...
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.
I put those lines in a custom rspec matcher, which may be the best I can do. Does that look better?
@@ -2,6 +2,7 @@ | |||
|
|||
class GraphqlController < ApplicationController | |||
before_action :fetch_params, only: [:execute] | |||
skip_before_action :verify_authenticity_token |
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.
The following should be added when we start doing adds, updates, and deletes:
except: [:create, :update, :destroy]
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.
Looks good to me
fixes #91