facebook invitations actually work
This commit is contained in:
parent
07850c7cb2
commit
9d091bbf6a
3 changed files with 3 additions and 1 deletions
|
|
@ -237,13 +237,13 @@ class User < ActiveRecord::Base
|
||||||
###Helpers############
|
###Helpers############
|
||||||
def self.build(opts = {})
|
def self.build(opts = {})
|
||||||
u = User.new(opts)
|
u = User.new(opts)
|
||||||
u.email = opts[:email]
|
|
||||||
u.setup(opts)
|
u.setup(opts)
|
||||||
u
|
u
|
||||||
end
|
end
|
||||||
|
|
||||||
def setup(opts)
|
def setup(opts)
|
||||||
self.username = opts[:username]
|
self.username = opts[:username]
|
||||||
|
self.email = opts[:email]
|
||||||
self.valid?
|
self.valid?
|
||||||
errors = self.errors
|
errors = self.errors
|
||||||
errors.delete :person
|
errors.delete :person
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,7 @@ describe InvitationsController do
|
||||||
@invited_user = @user.invite_user(@aspect.id, 'email', "a@a.com")
|
@invited_user = @user.invite_user(@aspect.id, 'email', "a@a.com")
|
||||||
@accept_params = {:user=>
|
@accept_params = {:user=>
|
||||||
{:password_confirmation =>"password",
|
{:password_confirmation =>"password",
|
||||||
|
:email => "a@a.com",
|
||||||
:username=>"josh",
|
:username=>"josh",
|
||||||
:password=>"password",
|
:password=>"password",
|
||||||
:invitation_token => @invited_user.invitation_token}}
|
:invitation_token => @invited_user.invitation_token}}
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@ describe User do
|
||||||
|
|
||||||
describe "#accept_invitation!" do
|
describe "#accept_invitation!" do
|
||||||
let(:invited_user) {@invited_user_pre.accept_invitation!(:invitation_token => "abc",
|
let(:invited_user) {@invited_user_pre.accept_invitation!(:invitation_token => "abc",
|
||||||
|
:email => "a@a.com",
|
||||||
:username => "user",
|
:username => "user",
|
||||||
:password => "secret",
|
:password => "secret",
|
||||||
:password_confirmation => "secret",
|
:password_confirmation => "secret",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue