Commit be57170b authored by zhitomirskiyi's avatar zhitomirskiyi

added the empty email spec

parent 8bc857cf
......@@ -46,7 +46,7 @@ GIT
GIT
remote: git://github.com/zhitomirskiyi/devise_invitable.git
revision: a52f9638f900c1af77855ec357a0c861fbb12e83
revision: 5f74da32a81a2332bac266316dab333a4eed9525
specs:
devise_invitable (0.4.rc)
devise (~> 1.2.rc)
......@@ -128,7 +128,7 @@ GEM
uuidtools
childprocess (0.1.6)
ffi (~> 0.6.3)
closure-compiler (0.3.3)
closure-compiler (1.0.0)
cloudfiles (1.4.10)
mime-types (>= 1.16)
columnize (0.3.2)
......@@ -142,7 +142,7 @@ GEM
term-ansicolor (~> 1.0.5)
cucumber-rails (0.3.2)
cucumber (>= 0.8.0)
culerity (0.2.14)
culerity (0.2.15)
daemons (1.1.0)
database_cleaner (0.6.0)
devise (1.2.rc)
......@@ -153,7 +153,7 @@ GEM
erubis (2.6.6)
abstract (>= 1.0.0)
eventmachine (0.12.10)
excon (0.3.4)
excon (0.4.0)
extlib (0.9.15)
factory_girl (1.3.3)
factory_girl_rails (1.0.1)
......@@ -193,12 +193,12 @@ GEM
closure-compiler (>= 0.1.0)
yui-compressor (>= 0.9.1)
json (1.4.6)
json_pure (1.4.6)
json_pure (1.5.1)
launchy (0.3.7)
configuration (>= 0.0.5)
rake (>= 0.8.1)
linecache (0.43)
mail (2.2.14)
mail (2.2.15)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
mime-types (~> 1.16)
......@@ -222,7 +222,7 @@ GEM
multipart-post (1.1.0)
mysql2 (0.2.6)
net-ldap (0.1.1)
net-ssh (2.0.23)
net-ssh (2.0.24)
nokogiri (1.4.3.1)
oa-basic (0.1.6)
multi_json (~> 0.0.2)
......@@ -306,7 +306,7 @@ GEM
rspec-core (2.4.0)
rspec-expectations (2.4.0)
diff-lcs (~> 1.1.2)
rspec-instafail (0.1.5)
rspec-instafail (0.1.6)
rspec-mocks (2.4.0)
rspec-rails (2.4.1)
actionpack (~> 3.0)
......@@ -344,7 +344,7 @@ GEM
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.14.6)
tilt (1.2.1)
tilt (1.2.2)
treetop (1.4.9)
polyglot (>= 0.3.1)
tzinfo (0.3.24)
......@@ -357,8 +357,8 @@ GEM
addressable (>= 2.2.2)
crack (>= 0.1.7)
will_paginate (3.0.pre2)
xml-simple (1.0.12)
yui-compressor (0.9.1)
xml-simple (1.0.13)
yui-compressor (0.9.3)
PLATFORMS
ruby
......
......@@ -71,6 +71,8 @@ class Invitation < ActiveRecord::Base
opts[:from].save!
invitee.reload
end
pp opts[:service]
pp opts[:service] == 'email'
invitee.invite!(:email => (opts[:service] == 'email'))
Rails.logger.info("event=invitation_sent to=#{opts[:identifier]} #{"inviter=#{opts[:from].diaspora_handle}" if opts[:from]}")
invitee
......
......@@ -239,6 +239,7 @@ describe Invitation do
it 'mails the optional message' do
new_user = Invitation.create_invitee(@valid_params)
pp Devise.mailer.deliveries
Devise.mailer.deliveries.first.to_s.include?(@message).should be_true
end
......@@ -252,6 +253,12 @@ describe Invitation do
new_user.should_not be_persisted
new_user.should have(1).error_on(:email)
end
it 'does not save a user with an empty string email' do
@valid_params[:service] = 'facebook'
@valid_params[:identifier] = '3423423'
Invitation.create_invitee(@valid_params).email.should_not == ''
end
end
context 'with no inviter' do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment