Skip to content
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

Merged
merged 3 commits into from
Nov 20, 2020

Conversation

mattlindsey
Copy link
Collaborator

@mattlindsey mattlindsey commented Nov 17, 2020

fixes #91

  • Tests all green tests and all builds passes 馃挌
  • PR well-named, issue linked 馃搸 and no merge conflicts.
  • Request review from other contributors

names = result.collect {|x| x["name"]}

assert names.detect { |e| e == 'FirstEvent' }
assert names.detect { |e| e == 'AnotherEvent' }
Copy link
Collaborator

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.

Copy link
Collaborator

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...

Copy link
Collaborator Author

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
Copy link
Collaborator Author

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]

Copy link
Collaborator

@aonomike aonomike left a 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

@aonomike aonomike merged commit ca6795e into AgileVentures:develop Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Testing: Test first graphql query
3 participants