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############
|
||||
def self.build(opts = {})
|
||||
u = User.new(opts)
|
||||
u.email = opts[:email]
|
||||
u.setup(opts)
|
||||
u
|
||||
end
|
||||
|
||||
def setup(opts)
|
||||
self.username = opts[:username]
|
||||
self.email = opts[:email]
|
||||
self.valid?
|
||||
errors = self.errors
|
||||
errors.delete :person
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ describe InvitationsController do
|
|||
@invited_user = @user.invite_user(@aspect.id, 'email', "a@a.com")
|
||||
@accept_params = {:user=>
|
||||
{:password_confirmation =>"password",
|
||||
:email => "a@a.com",
|
||||
:username=>"josh",
|
||||
:password=>"password",
|
||||
:invitation_token => @invited_user.invitation_token}}
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ describe User do
|
|||
|
||||
describe "#accept_invitation!" do
|
||||
let(:invited_user) {@invited_user_pre.accept_invitation!(:invitation_token => "abc",
|
||||
:email => "a@a.com",
|
||||
:username => "user",
|
||||
:password => "secret",
|
||||
:password_confirmation => "secret",
|
||||
|
|
|
|||
Loading…
Reference in a new issue