Specs mostly pass again
This commit is contained in:
parent
48959b3ded
commit
511f571ae5
5 changed files with 4 additions and 29 deletions
|
|
@ -29,11 +29,6 @@ class Post
|
|||
self.create params
|
||||
end
|
||||
|
||||
#Querying
|
||||
def self.newest_for(person)
|
||||
self.where(:person_id => person.id, :order => '_id desc')
|
||||
end
|
||||
|
||||
#ENCRYPTION
|
||||
xml_accessor :creator_signature
|
||||
key :creator_signature, String
|
||||
|
|
|
|||
|
|
@ -337,8 +337,8 @@ class User
|
|||
end
|
||||
|
||||
def setup_person
|
||||
self.person.serialized_key = generate_key.export
|
||||
self.person.email = email
|
||||
self.person.serialized_key ||= generate_key.export
|
||||
self.person.email ||= email
|
||||
self.person.save!
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ describe GroupsController do
|
|||
render_views
|
||||
before do
|
||||
@user = Factory.create(:user)
|
||||
@user.person.save
|
||||
@user.group(:name => "lame-os")
|
||||
@person = Factory.create(:person)
|
||||
request.env['warden'] = mock_model(Warden, :authenticate? => @user, :authenticate! => @user, :authenticate => @user)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ describe PeopleController do
|
|||
request.env['warden'] = mock_model(Warden, :authenticate? => @user, :authenticate! => @user, :authenticate => @user)
|
||||
|
||||
sign_in :user, @user
|
||||
@user.group(:name => "lame-os")
|
||||
end
|
||||
|
||||
it "index should yield search results for substring of person name" do
|
||||
|
|
|
|||
|
|
@ -5,27 +5,6 @@ describe Post do
|
|||
@user = Factory.create(:user, :email => "bob@aol.com")
|
||||
@user.person.save
|
||||
end
|
||||
|
||||
describe "newest" do
|
||||
before do
|
||||
@person_one = Factory.create(:person, :email => "some@dudes.com")
|
||||
@person_two = Factory.create(:person, :email => "other@dudes.com")
|
||||
(2..4).each { |n| Factory.create(:status_message, :message => "test #{n}", :person => @person_one) }
|
||||
(5..8).each { |n| Factory.create(:status_message, :message => "test #{n}", :person => @user.person)}
|
||||
(9..11).each { |n| Factory.create(:status_message, :message => "test #{n}", :person => @person_two) }
|
||||
|
||||
Factory.create(:status_message, :person => @user)
|
||||
Factory.create(:status_message, :person => @user)
|
||||
end
|
||||
|
||||
it "should give the most recent status_message title and body from owner" do
|
||||
status_message = StatusMessage.newest_for(@user.person)
|
||||
status_message.person.email.should == @user.person.email
|
||||
status_message.class.should == StatusMessage
|
||||
status_message.message.should == "test 8"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe 'xml' do
|
||||
it 'should serialize to xml with its person' do
|
||||
|
|
|
|||
Loading…
Reference in a new issue