title: active job with rails rspec
body: <p>I have installed a gem <code>rspec-rails</code>. Everything is working fine except <code>ActiveJob</code>.
  I have tried to implement the <code>ActiveJob</code> in RSpec with:</p>
  
  <pre><code>include ActiveJob::TestHelper
  </code></pre>
  
  <p>and here's the code for the RSsec Job Controller:</p>
  
  <pre><code>describe "#perform_later" do
    it "Send Invoice Reminder" do
      ActiveJob::Base.queue_adapter = :test
      InvoiceReminderJob.perform_later
      expect(InvoiceReminderJob).to have_enqueued_job
    end
  end
  </code></pre>
  
  <p><code>spec_helper.rb</code>:</p>
  
  <pre><code>require 'rails_helper'
  RSpec.describe InvoiceReminderJob, type: :job do
    include ActiveJob::TestHelper
    # pending "add some examples to (or delete) #{__FILE__}"
  
    describe "#perform_later" do
      it "Send Invoice Reminder" do
        ActiveJob::Base.queue_adapter = :test
        InvoiceReminderJob.perform("test")
        expect(InvoiceReminderJob).to have_enqueued_job
      end
    end
  end
  </code></pre>
  
  <p><code>invoice_reminder_job_spec.rb</code>:</p>
  
  <pre><code>require 'rails_helper'
  
  RSpec.describe InvoiceReminderJob, type: :job do
    # include ActiveJob::TestHelper
    # pending "add some examples to (or delete) #{__FILE__}"
  
    describe "#perform_later" do
      it "Send Invoice Reminder" do
        ActiveJob::Base.queue_adapter = :test
        InvoiceReminderJob.perform_later
        expect(InvoiceReminderJob).to have_enqueued_job
      end
    end
  end
  </code></pre>
  
  <p>When I am trying to run rspec with the command <code>rspec</code> I am getting the following error:</p>
  
  <blockquote>
    <p>uninitialized constant ActiveJob (NameError)</p>
  </blockquote>
  
  <p>Here is my <code>Gemfile</code>:</p>
  
  <p>Here is the gemfile included for my project:</p>
  
  <pre><code>source 'https://rubygems.org'
  ruby '2.1.2'
  
  gem 'acts-as-taggable-on', '~&gt; 3.4'
  gem 'acts_as_tenant'
  gem 'audited', '~&gt; 4.0'
  gem 'audited-activerecord'
  gem 'aws-sdk', '~&gt; 1.6'
  gem 'axlsx'
  gem 'best_in_place', '~&gt; 3.0.1'
  gem 'bootstrap-generators'
  gem 'bootstrap-sass'
  gem 'bullet', group: 'development'
  gem 'cancancan', '~&gt; 1.10'
  gem 'clockwork'
  gem 'coffee-rails', '~&gt; 4.1.0'
  gem 'daemons'
  gem 'delayed_job_active_record'
  gem 'devise'
  gem 'eefgilm'
  gem 'exception_notification'
  gem 'figaro'
  gem 'font-awesome-rails'
  gem 'i18n-js', '&gt;= 3.0.0.rc11'
  gem 'jbuilder', '~&gt; 2.0'
  gem 'jquery-rails'
  gem 'jquery-ui-rails'
  gem 'mailman'
  gem 'net-ssh'
  gem 'paperclip', '~&gt; 4.2'
  gem 'pg'
  gem 'protected_attributes'
  gem 'puma'
  gem 'rails', '4.1.5'
  gem 'rails-console-tweaks'
  gem 'rails-i18n'
  gem 'rails_best_practices'
  gem 'redcarpet'
  gem 'rest-client'
  gem 'roo'
  gem 'roo-google'
  gem 'roo-xls'
  gem 'rubocop', require: false
  gem 'sass-rails', '~&gt; 5.0'
  gem 'sdoc', '~&gt; 0.4.0', group: :doc
  gem 'seed_dump'
  gem 'simple_form'
  gem 'therubyracer', platforms: :ruby
  gem 'traceroute'
  gem 'twitter-bootstrap-rails'
  gem 'uglifier', '&gt;= 1.3.0'
  gem 'whenever', :require =&gt; false
  gem 'wicked_pdf'
  gem 'wkhtmltopdf-binary'
  gem 'zip'
  
  group :development do
    gem 'capistrano'
    gem 'capistrano3-puma'
    gem 'capistrano-bundler', require: false
    gem 'capistrano-rails', require: false
    gem 'capistrano-rvm'
    gem 'rails-erd'
    gem 'capistrano-rails-console', require: false
    gem 'capistrano-maintenance', '~&gt; 1.0', require: false
    gem 'letter_opener'
    gem 'rspec-rails'
    gem 'faker'
  end
  
  group :production do
    gem 'rails_12factor'
  end
  
  group :test do
    gem 'shoulda-matchers'
    gem 'database_cleaner'
    gem 'simplecov'
  end
  
  group :development, :test do
    gem 'byebug'
    gem 'hirb'
    gem 'mocha'
    gem 'activejob'
    gem 'factory_bot_rails'
  end
  </code></pre>
  
  <p>And here is the output of <code>bundle show activejob</code>:</p>
  
  <pre><code>/Users/221/.rvm/gems/ruby-2.1.2/gems/activejob-0
  </code></pre>
  
  <p>I have tried to search with lots of solution but I am not able to resolve this issue. If anyone could help me with it, I would be really grateful.</p>