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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: rspec matchers for testing? #12

Open
davydovanton opened this issue Jan 27, 2018 · 7 comments
Open

Question: rspec matchers for testing? #12

davydovanton opened this issue Jan 27, 2018 · 7 comments

Comments

@davydovanton
Copy link
Owner

No description provided.

@berniechiu
Copy link
Contributor

I would like to work on this, any suggestion at first?

@davydovanton
Copy link
Owner Author

thanks for help!
About suggestions: no idea. We can create some matchers for abilities and roles, WDYT? Also, we can check pundit or cancancan projects for inspiration 🤔

@berniechiu
Copy link
Contributor

Here's the first phase of PR i've done, lack of some functionalities but I think it's quite useful
#15

@davydovanton
Copy link
Owner Author

davydovanton commented Feb 10, 2018

After #15:

  • allow #permit to take ability name + payload for testing. Something like this:
expect(subject).not_to permit('post.edit', user, post)
  • Update README file and add information how to inject matchers and use it.

@berniechiu
Copy link
Contributor

berniechiu commented Feb 12, 2018

Just added here #16 ❤️

After finished it, I bumped into some issues, I think can change it

  • The abilities classes used in different files are actually shared, even though it looks like just defining a new one, which might cause different spec tests failing if changed unintentionally, maybe can use Struct to init them ?

@davydovanton
Copy link
Owner Author

@berniechiu not sure that I understand correct, could you explain little bit more why you want to use Struct?

@berniechiu
Copy link
Contributor

Oh! Other solutions are ok, just that the classes are re-opened in each spec file, which looks weird since each spec file supposedly is using the test class individually.

@davydovanton davydovanton removed this from the v0.3 milestone Jun 13, 2018
@davydovanton davydovanton added this to Inbox in Development Oct 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development
  
Inbox
Development

No branches or pull requests

2 participants