Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Don't subscribe in tests. #3

Merged
merged 1 commit into from

2 participants

@lukerandall
Owner

Currently, unless a user has set test: false in their config file, creating users in tests will subscribe them in CM. I think this is mostly likely not what is expected.

@mpowered mpowered merged commit 8389e2f into mpowered:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 20, 2011
  1. @lukerandall

    Don't subscribe in tests.

    lukerandall authored
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/campaign_monitor_subscriber.rb
View
2  lib/campaign_monitor_subscriber.rb
@@ -4,7 +4,7 @@ module CampaignMonitorSubscriber
::CAMPAIGN_MONITOR_API_KEY = CM_CONFIG['api_key']
def subscribe_me_using(email_field, custom_fields={})
- return if CM_CONFIG[::Rails.env] == false
+ return if CM_CONFIG[::Rails.env] == false or %w(cucumber test).include? ::Rails.env
after_create do |record|
begin
custom_fields = custom_fields.inject({}) { |h, (k, v)| h[k] = record.send(v); h }
Something went wrong with that request. Please try again.