Skip to content

Commit b1db725

Browse files
committed
Working to make all version work.
1 parent 9019653 commit b1db725

File tree

4 files changed

+75
-2
lines changed

4 files changed

+75
-2
lines changed

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@ group :development, :test do
1414
gem 'yard'
1515
gem 'rubocop-git'
1616
gem 'aws-sdk-sns'
17+
gem 'webmock'
18+
gem 'rack'
19+
gem 'sinatra', '>= 2', '< 4'
1720
end

event_source.gemspec

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,4 @@ Gem::Specification.new do |spec|
6161
spec.add_development_dependency 'database_cleaner'
6262
spec.add_development_dependency 'faker'
6363
spec.add_development_dependency 'mongoid'
64-
spec.add_development_dependency 'webmock'
65-
spec.add_development_dependency 'sinatra'
6664
end

spec/event_source_spec.rb

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# frozen_string_literal: true
2+
3+
require 'spec_helper'
4+
5+
# This spec verifies Webmock is intercepting network API calls
6+
RSpec.describe EventSource do
7+
it 'queries an outside source' do
8+
uri =
9+
URI('https://api.github.com/repos/thoughtbot/factory_girl/contributors')
10+
11+
response = Oj.load(Net::HTTP.get(uri))
12+
expect(response.first['login']).to eq 'joshuaclayton'
13+
# expect(response).to be_an_instance_of(String)
14+
end
15+
end
16+
17+
# RSpec.describe Parties::Organization::CorrectOrUpdateFein do
18+
# context 'Call the Organization Create Service and store a record with an incorrect FEIN value' do
19+
# let(:legal_name) { 'Spacely Sprockets, Inc.' }
20+
# let(:entity_kind) { :s_corporation }
21+
# let(:bad_fein) { '111111111' }
22+
# let(:current_time) { Time.now }
23+
# let(:metadata) { { created_at: current_time, updated_at: current_time } }
24+
25+
# let(:org_params) do
26+
# {
27+
# legal_name: legal_name,
28+
# entity_kind: entity_kind,
29+
# fein: bad_fein,
30+
# metadata: metadata
31+
# }
32+
# end
33+
34+
# let!(:event) { Organizations::Create.call(org_params) }
35+
36+
# context 'then with the same Organization, call the UpdateFein Service with the corrected FEIN value' do
37+
# let(:corrected_fein) { '555555555' }
38+
# let(:updated_timestamp) { Time.now }
39+
# let(:updated_event_type) { 'Organizations::FeinUpdated' }
40+
# let(:organization_class) { 'Organizations::Organization'.constantize }
41+
42+
# subject do
43+
# described_class.call(
44+
# organization: event.source_model,
45+
# fein: corrected_fein,
46+
# metadata: {
47+
# created_at: event.source_model.created_at,
48+
# updated_at: updated_timestamp
49+
# }
50+
# )
51+
# end
52+
53+
# # it 'should return an Event instance of the correct type' do
54+
# # expect(subject).to be_a EventSource::EventStream
55+
# # expect(subject._type).to eq updated_event_type
56+
# # end
57+
58+
# # it 'the persisted model record should have the corrected FEIN value' do
59+
# # expect(
60+
# # organization_class.find(subject.source_model.id).fein
61+
# # ).to eq corrected_fein
62+
# # end
63+
64+
# # it 'and the EventStream should have an associated record of the state change' do
65+
# # events = organization_class.find(subject.source_model.id).events
66+
# # expect(events.size).to eq 2
67+
# # expect(events.last.fein).to eq corrected_fein
68+
# # end
69+
# end
70+
# end
71+
# end

spec/support/apis/fake_github.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# frozen_string_literal: true
22

3+
require 'rack'
34
require 'sinatra/base'
45

56
class FakeGitHub < Sinatra::Base

0 commit comments

Comments
 (0)