Skip to content

Instantly share code, notes, and snippets.

@Pomeha
Last active March 2, 2020 11:45
Show Gist options
  • Save Pomeha/6a79a97668b761f6ed5d6eee9ff3dc12 to your computer and use it in GitHub Desktop.
Save Pomeha/6a79a97668b761f6ed5d6eee9ff3dc12 to your computer and use it in GitHub Desktop.
заглушки
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe Comments::List do
subject do
service.(
client,
recommendation_id: 'REC_ID',
last_id: 'LAST_ID',
limit: 'LIMIT'
)
end
let(:service) do
described_class.new(
find_recommendation: calls.spy(:find_recommendation, 'REC'),
comments: calls.spy(:comments, ['COMMENT'])
)
end
let(:client) { build(:client) }
it 'returns comments' do
expect(subject).to eq ['COMMENT']
expect(calls[:find_recommendation]).to eq [['REC_ID', client.recommendations]]
expect(calls[:comments]).to eq [%w[REC LAST_ID LIMIT]]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment