require "spec_helper" describe SignUp do before do @sign_up = SignUp.new end 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' } let(:list_id) { ENV['MAILCHIMP_LIST_ID'] } before :each do sign_up.subscribe end after :each do gibbon.list_unsubscribe(id: 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(list_id) end end end