Open davydovanton opened 6 years ago
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 🤔
Here's the first phase of PR i've done, lack of some functionalities but I think it's quite useful https://github.com/davydovanton/kan/pull/15
After #15:
[x] allow #permit to take ability name + payload for testing. Something like this:
expect(subject).not_to permit('post.edit', user, post)
[x] Update README file and add information how to inject matchers and use it.
Just added here https://github.com/davydovanton/kan/pull/16 ❤️
After finished it, I bumped into some issues, I think can change it
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 ?@berniechiu not sure that I understand correct, could you explain little bit more why you want to use Struct
?
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.
I would like to work on this, any suggestion at first?