Sha256: 12d32d67a6a50a3829cfe6c37b81733d6e2e232ba4e52af1372749fc3c8e0c7d

Contents?: true

Size: 886 Bytes

Versions: 6

Compression:

Stored size: 886 Bytes

Contents

require 'spec_helper'

RSpec.describe CmQuiz::Review::GetUserInfo do
  describe '#perform' do
    let!(:project_api) do
      api = double
      allow(api).to receive(:request) do |verb, path, opts|
        double(success?: true, body: { email: email, name: name}.to_json, code: 200)
      end
      api
    end
    let(:hex) { '58714e1256' }
    let(:name) { "codementor-test-#{hex}" }
    let(:email) { "#{name}@codementor.io"}
    let(:service) do
      CmQuiz::Review::GetUserInfo.new({
        project_api: project_api
      })
    end
    before :each do
      factory = double(create: ['jwt', 'refresh_token'])
      allow(CmQuiz::Factory::User).to receive(:new).and_return(factory)
      allow(SecureRandom).to receive(:hex).and_return(hex)
    end

    it "should pass test" do
      test_result = service.perform

      assert_test_case(service, test_result)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cm_quiz-0.0.8 spec/lib/cm_quiz/review/get_user_info_spec.rb
cm_quiz-0.0.7 spec/lib/cm_quiz/review/get_user_info_spec.rb
cm_quiz-0.0.6 spec/lib/cm_quiz/review/get_user_info_spec.rb
cm_quiz-0.0.5 spec/lib/cm_quiz/review/get_user_info_spec.rb
cm_quiz-0.0.4 spec/lib/cm_quiz/review/get_user_info_spec.rb
cm_quiz-0.0.3 spec/lib/cm_quiz/review/get_user_info_spec.rb