Code Monkey home page Code Monkey logo

rails-sidekiq-lab-v-000's Introduction

Sidekiq Lab

Objectives

  1. Move a long-running task to Sidekiq

Overview

In this lab, we're going to add Sidekiq to the song library so that we can upload a CSV of songs and artists in a background worker.

You will find a CSV of classic rock songs and artists in db\songs.csv. Use it to test your work!

Note: This list is provided by FiveThirtyEight and is available under Creative Commons Attribution 4.0 International License.

Instructions

  1. Use Sidekiq to process the songs csv upload with a SongsWorker background worker.
  2. Make sure tests pass!

Note The sidekiq gem has been included for you in the Gemfile. Note This is a working application so there are some tests intentionally passing already.

View Sidekiq Lab on Learn.co and start learning to code for free.

rails-sidekiq-lab-v-000's People

Contributors

annjohn avatar blake41 avatar curiositypaths avatar danielseehausen avatar maxwellbenton avatar scottcreynolds avatar sgharms avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rails-sidekiq-lab-v-000's Issues

Songs_Controller_Spec file upload test written incorrectly

Need to change the file: upload syntax in the "uploads and processes a file on a background worker" test starting on line 10 from this:

it "uploads and processes a file on a background worker" do
      post :upload, file: fixture_file_upload('songs.csv', 'text/csv')
      expect(SongsWorker.jobs.size).to eq 1
    end

TO

  it "uploads and processes a file on a background worker" do
      params = {file: fixture_file_upload('songs.csv', 'text/csv')}
      post :upload, params: params
      expect(SongsWorker.jobs.size).to eq 1
    end

Lab totally broken on Ubuntu 16.04

To fix this I had to take many steps to get rails/rspec to work. My local version of Ruby is Ruby 2.5.0 and local Rails version is Rails 5.1.6.

  1. Install ruby version 2.3.3 via "rbenv install 2.3.3"
  2. Set local ruby version while inside the lab app directory via "rbenv local 2.3.3"
  3. Re-install bundler via "gem install bundler"
  4. Run "bundle install"
  5. Remove "config.active_record.raise_in_transactional_callbacks = true" from the /config/application.rb file.

Ruby Sass is deprecated and will be unmaintained as of 26 March 2019

Post-install message from sass:

Ruby Sass is deprecated and will be unmaintained as of 26 March 2019.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.