rspec is green

This commit is contained in:
Maxwell Salzberg 2011-07-12 19:25:57 -07:00 committed by Raphael Sofaer
parent df62f58156
commit eee2225f04
5 changed files with 10 additions and 6 deletions

View file

@ -55,7 +55,6 @@ class InvitationsController < Devise::InvitationsController
user.accept_invitation!(params[:user])
user.seed_aspects
rescue Exception => e #What exception is this trying to rescue? If it is ActiveRecord::NotFound, we should say so.
raise e
user = nil
record = e.record
record.errors.delete(:person)

View file

@ -20,6 +20,6 @@ module CommentsHelper
def new_comment_form(post_id, current_user)
@form ||= controller.render_to_string(
:partial => 'comments/new_comment', :locals => {:post_id => GSUB_THIS, :current_user => current_user})
@form.gsub(GSUB_THIS, post_id.to_s)
@form.gsub(GSUB_THIS, post_id.to_s).html_safe
end
end

View file

@ -1,6 +1,12 @@
# Copyright (c) 2010, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
#
class OpenSSL::PKey::RSA
def to_yaml
self.to_s
end
end
class Invitation < ActiveRecord::Base
@ -26,7 +32,6 @@ class Invitation < ActiveRecord::Base
raise "You already invited this person"
end
end
opts[:existing_user] = existing_user
create_invitee(opts)
end

View file

@ -343,7 +343,7 @@ class User < ActiveRecord::Base
def self.generate_key
key_size = (Rails.env == 'test' ? 512 : 4096)
OpenSSL::PKey::RSA::generate key_size
OpenSSL::PKey::RSA::generate(key_size)
end
def encryption_key

View file

@ -39,7 +39,7 @@ describe PeopleController do
:profile => Factory.build(:profile, :first_name => "Eugene",
:last_name => "w"))
get :index, :q => "Eug"
assigns[:people].should =~ [@eugene, eugene2]
assigns[:people].map{|x| x.id}.should =~ [@eugene.id, eugene2.id]
end
it "excludes people that are not searchable" do
@ -55,7 +55,7 @@ describe PeopleController do
:profile => Factory.build(:profile, :first_name => "Eugene",
:last_name => "w", :searchable => false))
get :index, :q => "eugene@example.org"
assigns[:people].should =~ [eugene2]
assigns[:people][0].id.should == eugene2.id
end
it "does not redirect to person page if there is exactly one match" do