rspec is green
This commit is contained in:
parent
df62f58156
commit
eee2225f04
5 changed files with 10 additions and 6 deletions
|
|
@ -55,7 +55,6 @@ class InvitationsController < Devise::InvitationsController
|
||||||
user.accept_invitation!(params[:user])
|
user.accept_invitation!(params[:user])
|
||||||
user.seed_aspects
|
user.seed_aspects
|
||||||
rescue Exception => e #What exception is this trying to rescue? If it is ActiveRecord::NotFound, we should say so.
|
rescue Exception => e #What exception is this trying to rescue? If it is ActiveRecord::NotFound, we should say so.
|
||||||
raise e
|
|
||||||
user = nil
|
user = nil
|
||||||
record = e.record
|
record = e.record
|
||||||
record.errors.delete(:person)
|
record.errors.delete(:person)
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,6 @@ module CommentsHelper
|
||||||
def new_comment_form(post_id, current_user)
|
def new_comment_form(post_id, current_user)
|
||||||
@form ||= controller.render_to_string(
|
@form ||= controller.render_to_string(
|
||||||
:partial => 'comments/new_comment', :locals => {:post_id => GSUB_THIS, :current_user => current_user})
|
: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
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,12 @@
|
||||||
# Copyright (c) 2010, Diaspora Inc. This file is
|
# Copyright (c) 2010, Diaspora Inc. This file is
|
||||||
# licensed under the Affero General Public License version 3 or later. See
|
# licensed under the Affero General Public License version 3 or later. See
|
||||||
# the COPYRIGHT file.
|
# the COPYRIGHT file.
|
||||||
|
#
|
||||||
|
class OpenSSL::PKey::RSA
|
||||||
|
def to_yaml
|
||||||
|
self.to_s
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
class Invitation < ActiveRecord::Base
|
class Invitation < ActiveRecord::Base
|
||||||
|
|
||||||
|
|
@ -26,7 +32,6 @@ class Invitation < ActiveRecord::Base
|
||||||
raise "You already invited this person"
|
raise "You already invited this person"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
opts[:existing_user] = existing_user
|
opts[:existing_user] = existing_user
|
||||||
create_invitee(opts)
|
create_invitee(opts)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -343,7 +343,7 @@ class User < ActiveRecord::Base
|
||||||
|
|
||||||
def self.generate_key
|
def self.generate_key
|
||||||
key_size = (Rails.env == 'test' ? 512 : 4096)
|
key_size = (Rails.env == 'test' ? 512 : 4096)
|
||||||
OpenSSL::PKey::RSA::generate key_size
|
OpenSSL::PKey::RSA::generate(key_size)
|
||||||
end
|
end
|
||||||
|
|
||||||
def encryption_key
|
def encryption_key
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ describe PeopleController do
|
||||||
:profile => Factory.build(:profile, :first_name => "Eugene",
|
:profile => Factory.build(:profile, :first_name => "Eugene",
|
||||||
:last_name => "w"))
|
:last_name => "w"))
|
||||||
get :index, :q => "Eug"
|
get :index, :q => "Eug"
|
||||||
assigns[:people].should =~ [@eugene, eugene2]
|
assigns[:people].map{|x| x.id}.should =~ [@eugene.id, eugene2.id]
|
||||||
end
|
end
|
||||||
|
|
||||||
it "excludes people that are not searchable" do
|
it "excludes people that are not searchable" do
|
||||||
|
|
@ -55,7 +55,7 @@ describe PeopleController do
|
||||||
:profile => Factory.build(:profile, :first_name => "Eugene",
|
:profile => Factory.build(:profile, :first_name => "Eugene",
|
||||||
:last_name => "w", :searchable => false))
|
:last_name => "w", :searchable => false))
|
||||||
get :index, :q => "eugene@example.org"
|
get :index, :q => "eugene@example.org"
|
||||||
assigns[:people].should =~ [eugene2]
|
assigns[:people][0].id.should == eugene2.id
|
||||||
end
|
end
|
||||||
|
|
||||||
it "does not redirect to person page if there is exactly one match" do
|
it "does not redirect to person page if there is exactly one match" do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue