Reputation: 115511
I've developed a gem which is to use inside a model by adding acts_as_gmappable
and it's possible to pass options in the declaration.
Now that I want to write tests with Rspec, I'm stuck for all model related functions:
I know how to do these inside a Rails app but definitly not for a gem. Any track?
Upvotes: 3
Views: 764
Reputation: 115511
I managed to do this by reading the excellent book of Jose Valim:
http://plataformatec.com.br/crafting-rails-applications/
He describes how he tests his gem using his engine builder:
https://github.com/josevalim/enginex
Upvotes: 3