- Spree Commerce Test Task to add a feature that will let admins upload products to the Spree database from a
.csv
file
-
Clone this repo
git clone https://github.com/mercyoseni/spree-test-task.git
-
Install the gem dependencies
bundle install
-
To setup database and run migrations
rails db:setup
-
To load seed data, run
bundle exec rake spree_sample:load
-
To run the app (use different tabs):
- run
redis-server
to start Redis (You can install usingbrew install redis
) - run
rails s
to start the server - run
bundle exec sidekiq
to run Sidekiq
- run
- Here is the sample.csv file to import products.
;name;description;price;availability_date;slug;stock_total;category ;Ruby on Rails Bag;Animi officia aut amet molestiae atque excepturi. Placeat est cum occaecati molestiae quia. Ut soluta ipsum doloremque perferendis eligendi voluptas voluptatum.;22,99;2017-12-04T14:55:22.913Z;ruby-on-rails-bag;15;Bags ;Spree Bag;Rerum quaerat autem non nihil quo laborum aut hic. Iure adipisci neque eum qui dolor. Velit sed molestias nostrum et dolore. Amet sed repellendus quod et ad.;25,99;2017-12-04T14:55:22.913Z;spree-bag;5;Bags ;Spree Tote;Consequuntur quibusdam repellendus quia non. Iste et pariatur nulla fugit. In ipsum accusantium quasi mollitia et eos. Ullam veniam quis ut adipisci est autem molestiae eos. Ab necessitatibus et rerum quasi quia debitis eum.;14,99;2017-12-30T14:55:22.913Z;spree-tote;20;Bags
When an Admin bypasses the frontend validation and submit, the page displays the related error message
- To run the tests, run
rspec spec