summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2013-07-22 12:04:10 -0600
committermo khan <mo@mokhan.ca>2013-07-22 12:04:10 -0600
commitb7541657a47f237ccbb86faecb18623d1c34f3e9 (patch)
treed0a9f744a7e3a8ced6d0f8be22351d2c5e537463 /spec
parent795feaa3efd9fa3e3f4c29e292d618d080a29558 (diff)
allow signups to subscribe to a mailing list
Diffstat (limited to 'spec')
-rw-r--r--spec/models/sign_up_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/models/sign_up_spec.rb b/spec/models/sign_up_spec.rb
index e43bbf3..0c27680 100644
--- a/spec/models/sign_up_spec.rb
+++ b/spec/models/sign_up_spec.rb
@@ -8,4 +8,23 @@ describe SignUp do
subject { @sign_up }
it { should respond_to(:email) }
+
+ context :subscribe do
+ let(:sign_up) { SignUp.new(email: email) }
+ let(:gibbon) { Gibbon.new(ENV['MAILCHIMP_API_KEY']) }
+ let(:email) { 'example@parleytool.com' }
+
+ before :each do
+ sign_up.subscribe
+ end
+
+ after :each do
+ gibbon.list_unsubscribe(id: ENV['MAILCHIMP_LIST_ID'], email_address: email)
+ end
+
+ it "should subscribe to the mailchimp email list" do
+ results = gibbon.lists_for_email(email_address: email)
+ results.should include(ENV['MAILCHIMP_LIST_ID'])
+ end
+ end
end