Skip to content

Commit

Permalink
13 - move createsend stub to CampaignMonitorStubs module
Browse files Browse the repository at this point in the history
  • Loading branch information
gamesover committed Dec 22, 2024
1 parent 60b1d8c commit 173d4ef
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
3 changes: 3 additions & 0 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,7 @@
config.filter_rails_from_backtrace!
# arbitrary gems may also be filtered via:
# config.filter_gems_from_backtrace("gem name")
config.before(:each) do
CampaignMonitorStubs.configure
end
end
9 changes: 0 additions & 9 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,4 @@
# # test failures related to randomization by passing the same `--seed` value
# # as the one that triggered the failure.
# Kernel.srand config.seed
config.before(:each) do
# all confirmed email, we need to update subscribers
stub_request(:get, %r{https://api.createsend.com/api/v3.3/subscribers/(camp-key|conf-key|girls-key).json})
.to_return(
status: 200,
body: { State: "Active" }.to_json,
headers: { 'Content-Type': 'application/json' }
)
end
end
11 changes: 11 additions & 0 deletions spec/support/campaign_monitor_stubs.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module CampaignMonitorStubs
def self.configure
WebMock
.stub_request(:get, %r{https://api.createsend.com/api/v3.3/subscribers/(camp-key|conf-key|girls-key).json})
.to_return(
status: 200,
body: { State: "Active" }.to_json,
headers: { 'Content-Type': 'application/json' }
)
end
end

0 comments on commit 173d4ef

Please sign in to comment.