Skip to content

Spree Commerce Test Task to add a feature that will let admins upload products to the Spree database from a .csv file

Notifications You must be signed in to change notification settings

mercyoseni/spree-test-task

Repository files navigation

Spree Test Task

  • Spree Commerce Test Task to add a feature that will let admins upload products to the Spree database from a .csv file

Getting Started

  • 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 using brew install redis)
    • run rails s to start the server
    • run bundle exec sidekiq to run Sidekiq

Import Products CSV

  • 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
    

Screenshots:

Upload Product CSV modal

Screenshot 2019-06-23 at 7 49 32 PM

The modal requires a file before submission

Screenshot 2019-06-23 at 7 55 14 PM (2)

When an Admin bypasses the frontend validation and submit, the page displays the related error message

Screenshot 2019-06-23 at 7 56 37 PM (2)

Product Import Report Page

While the background job is running

Screenshot 2019-06-24 at 4 37 35 AM (2)

After the background job is completed

Screenshot 2019-06-24 at 4 37 45 AM (2)

Tests

  • To run the tests, run rspec spec

Reference

About

Spree Commerce Test Task to add a feature that will let admins upload products to the Spree database from a .csv file

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published