I 'm trying to write an `RSpec` test for this service. The service below essentially just makes a call to some endpoint and then create data in the `postgres` DB. 

```
class SomeService
  API_URL = "someEndPoint"
  def process
    get_reviews
  end

  def get_reviews
    conn = Faraday.new(url: "#{APIURL}/#{ENV["ID"]}/reviews?language=en&stars=5") do |faraday|
      faraday.headers["apikey"] = ENV["KEY"]
      faraday.adapter Faraday.default_adapter
    end
    response = conn.get
    imported_reviews = []
    results = JSON.parse(response.body)
    results["reviews"].each do |item|
      review = SomeModel.create(
        title: item["title"],
        body: item["text"],
        posted_at: item["createdAt"],
        link: "https://somelink.com/#{item["id"]}",
        display_name: item["consumer"]["displayName"]
      )
      imported_reviews << review
    end
    imported_reviews
  end
end

```

My model is just the boilerplate model shown as:

```
class SomeModel < ApplicationRecord
end

```

This is my spec file `some_service_spec.rb`. I've written plenty of tests in JEST but it's just so foreign to me in Ruby. 

```
# frozen_string_literal: true

require 'rails_helper'

describe TrustpilotService do
  describe "#process" do
    context 'with valid API_KEY' do
      before :all do
        WebMock.allow_net_connect!
      end
      after :all do
        WebMock.disable_net_connect!(allow_localhost: true)
      end
      it "should import reviews to database" do
        key = "90e0dbc7160d4024a1f12bc24b3d1def" #fake key#
        some_review = create(title: 'Blah', body: 'Blah blah', posted_at: '2019-09-30T20:35:14Z', link: 'https://somelink.com/reviews/asdf123', display_name: 'Jane Doe')
        some_review.save!
        service = described_class.new
        expect{ service.process }.to change{ SomeModel.count }
      end
    end
  end
end

```

*Edit* added my factory for reference

```
FactoryBot.define do
  factory :trustpilot_review do

  end
end

```

Gem File

```
group :test do
  gem "capybara", "~> 3.29.0"
  gem 'database_cleaner'
  gem 'factory_bot_rails'
  gem 'rails-controller-testing'
  gem 'rspec-rails', '~> 3.8'
  gem 'rspec-snapshot', '~> 0.1.2'
  gem "shoulda-matchers"
  gem "simplecov", require: false
  gem 'timecop'
  gem "webdrivers"
  gem 'webmock'
end

```

I essentially was just trying to replicate another spec file that was testing a service that does sort of the same thing but I'm getting `Factory not registered:` as an error. I created a factory but not entirely sure what to even put in it. All of the info on RSPEC out there is kind of outdated. As you can tell, I'm pretty new to Ruby so any help is appreciated.