New gem - testing execution of action filters with RSpec

19 views
Skip to first unread message

Lazarus Lazaridis

unread,
Mar 9, 2015, 2:10:27 PM3/9/15
to rs...@googlegroups.com
Hello everybody,

I published my first gem (rspec-matchers-controller_filters) for testing execution of before/around/after filters of controller actions with RSpec.


Any feedback is welcome!

Thanks,
Lazarus

Jon Rowe

unread,
Mar 9, 2015, 6:37:39 PM3/9/15
to rs...@googlegroups.com
Congratulations!

Some quick feedback, you should add a `rspec-matchers-controller_filters.rb` file to your lib folder that just requires `rspec/matchers/controller_filters` so that your gem can be loaded by bundler automatically. You should also target `rspec-rails ~> 3.0` rather than 3 to ensure any minor version of RSpec 3, but without RSpec 4 (which could break your gem in future).

As an asidel you’re not really testing execution of action filters, but ensuring they’re setup, generally I’d expect this to be tested with integration tests rather than stubbing against the controller but if it works for you then great!

You could also setup TravisCI to ensure PR’s and such run your tests to help people contributing to your project.

Keep up the good work :)

Jon Rowe
---------------------------

--
You received this message because you are subscribed to the Google Groups "rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+un...@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/13dc4c80-4ea7-49f2-b5bd-6920bfc32342%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Actibities

unread,
Mar 9, 2015, 6:45:48 PM3/9/15
to rs...@googlegroups.com
Hi Jon,

Thank you very much for your time and your valuable feedback!

I'll follow your suggestions.

Best,
Lazarus
You received this message because you are subscribed to a topic in the Google Groups "rspec" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rspec/S-5xHxtHGrI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rspec+un...@googlegroups.com.

To post to this group, send email to rs...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages