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

Adding Tests #12

Open
joshmcarthur opened this issue Dec 14, 2011 · 1 comment
Open

Adding Tests #12

joshmcarthur opened this issue Dec 14, 2011 · 1 comment

Comments

@joshmcarthur
Copy link
Owner

Hi everyone,

I'm adding this issue to ask if anyone is able to help me out to get spree-import-products covered by specs. I've spent the last few weeks trying to get my head around the best way to do the following things:

  1. Testing for multiple versions of Spree: I'm keen to maintain backwards compatibility with Spree, ideally back to the version for which I built this extension (0.30, I believe). The challenges I've faced here include architecting the extension to work with different versions, and, in particular, how to generate some sort of test app that I can test the extension with. Spree's generators for test apps seem to have changed over versions, so it's not a simple command I can run, and different versions seem to have different requirements of the extension.
  2. Writing concise, useful specs that cover the majority of the code base: while I've written RSpec specs before on more than one occasion, I've not yet managed to write specs for an application that I'm happy with in terms of conciseness and usefulness.

So far, I've had a nice strategy suggested to me to use a Versionfile to manage backwards compatibility. This would involve having a branch dedicated to each version of Spree that should be supported. This simplifies generating sandbox Spree apps for running specs against, and code that is specific to one or more versions (Such as deface support).

I would appreciate any offers to either try and get a testing infrastructure set up that myself and others can run specs against, to add specs yourself, to help me out, or generally to offer opinions and advice. I'll continue to monitor and feedback on this issue as I carry on trying to get a testing infrastructure in place.

@autotelik
Copy link

Hi Josh, I have a fair amount of specs and coverage for a active record import/export project which grew out of some Spree work so has specific Spree loader, tasks and specs.

https://github.com/autotelik/interact

You may be able to use these specs as a basis for your own - there is a number of csv files with spree test data,(plus .xls files which can easily be converted to csv)

Also as this is a non spree gem, I've written some test helpers that dynamically generate a Spree database and load the spree gem, so no need to manually create a Spree app each time .. which may help with the different version situation.

Also wondered whether perhaps you fancied working on a combined solution together. My project currently focused on rake tasks but could be nice to also have a Spree extension making it available through the /admin section.

Either way, feel free to copy/use/steal/borrow any of the specs that might help you.

And Merry Christmas !

tom

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

No branches or pull requests

2 participants