Merge branch 'upgrade_rails'
This commit is contained in:
commit
ae29e2478a
12 changed files with 85 additions and 77 deletions
5
Gemfile
5
Gemfile
|
|
@ -3,7 +3,7 @@ source 'http://rubygems.org'
|
||||||
gem 'mysql2', '0.2.6'
|
gem 'mysql2', '0.2.6'
|
||||||
#gem 'pg'
|
#gem 'pg'
|
||||||
#gem 'sqlite3'
|
#gem 'sqlite3'
|
||||||
gem 'rails', '3.0.3'
|
gem 'rails', '3.0.9'
|
||||||
gem 'foreigner', '0.9.1'
|
gem 'foreigner', '0.9.1'
|
||||||
gem 'activerecord-import'
|
gem 'activerecord-import'
|
||||||
|
|
||||||
|
|
@ -32,7 +32,8 @@ gem 'faraday'
|
||||||
gem 'faraday-stack'
|
gem 'faraday-stack'
|
||||||
|
|
||||||
#Views
|
#Views
|
||||||
gem 'haml', '3.0.25'
|
gem 'haml', '3.1.2'
|
||||||
|
gem 'sass', '3.1.4'
|
||||||
gem 'will_paginate', '3.0.pre2'
|
gem 'will_paginate', '3.0.pre2'
|
||||||
|
|
||||||
#Localization
|
#Localization
|
||||||
|
|
|
||||||
106
Gemfile.lock
106
Gemfile.lock
|
|
@ -31,7 +31,7 @@ GIT
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: git://github.com/diaspora/diaspora-client.git
|
remote: git://github.com/diaspora/diaspora-client.git
|
||||||
revision: 7924e3cc576e54b5ade4014caea8b79e9f1d6343
|
revision: 1421deef3df1f7fd9e04d13cc4c86e0d08747f1a
|
||||||
specs:
|
specs:
|
||||||
diaspora-client (0.0.0)
|
diaspora-client (0.0.0)
|
||||||
activerecord
|
activerecord
|
||||||
|
|
@ -72,34 +72,34 @@ GEM
|
||||||
Platform (0.4.0)
|
Platform (0.4.0)
|
||||||
SystemTimer (1.2.1)
|
SystemTimer (1.2.1)
|
||||||
abstract (1.0.0)
|
abstract (1.0.0)
|
||||||
actionmailer (3.0.3)
|
actionmailer (3.0.9)
|
||||||
actionpack (= 3.0.3)
|
actionpack (= 3.0.9)
|
||||||
mail (~> 2.2.9)
|
mail (~> 2.2.19)
|
||||||
actionpack (3.0.3)
|
actionpack (3.0.9)
|
||||||
activemodel (= 3.0.3)
|
activemodel (= 3.0.9)
|
||||||
activesupport (= 3.0.3)
|
activesupport (= 3.0.9)
|
||||||
builder (~> 2.1.2)
|
builder (~> 2.1.2)
|
||||||
erubis (~> 2.6.6)
|
erubis (~> 2.6.6)
|
||||||
i18n (~> 0.4)
|
i18n (~> 0.5.0)
|
||||||
rack (~> 1.2.1)
|
rack (~> 1.2.1)
|
||||||
rack-mount (~> 0.6.13)
|
rack-mount (~> 0.6.14)
|
||||||
rack-test (~> 0.5.6)
|
rack-test (~> 0.5.7)
|
||||||
tzinfo (~> 0.3.23)
|
tzinfo (~> 0.3.23)
|
||||||
activemodel (3.0.3)
|
activemodel (3.0.9)
|
||||||
activesupport (= 3.0.3)
|
activesupport (= 3.0.9)
|
||||||
builder (~> 2.1.2)
|
builder (~> 2.1.2)
|
||||||
i18n (~> 0.4)
|
i18n (~> 0.5.0)
|
||||||
activerecord (3.0.3)
|
activerecord (3.0.9)
|
||||||
activemodel (= 3.0.3)
|
activemodel (= 3.0.9)
|
||||||
activesupport (= 3.0.3)
|
activesupport (= 3.0.9)
|
||||||
arel (~> 2.0.2)
|
arel (~> 2.0.10)
|
||||||
tzinfo (~> 0.3.23)
|
tzinfo (~> 0.3.23)
|
||||||
activerecord-import (0.2.7)
|
activerecord-import (0.2.7)
|
||||||
activerecord (~> 3.0.0)
|
activerecord (~> 3.0.0)
|
||||||
activeresource (3.0.3)
|
activeresource (3.0.9)
|
||||||
activemodel (= 3.0.3)
|
activemodel (= 3.0.9)
|
||||||
activesupport (= 3.0.3)
|
activesupport (= 3.0.9)
|
||||||
activesupport (3.0.3)
|
activesupport (3.0.9)
|
||||||
addressable (2.2.4)
|
addressable (2.2.4)
|
||||||
archive-tar-minitar (0.5.2)
|
archive-tar-minitar (0.5.2)
|
||||||
arel (2.0.10)
|
arel (2.0.10)
|
||||||
|
|
@ -148,19 +148,19 @@ GEM
|
||||||
closure-compiler (1.1.1)
|
closure-compiler (1.1.1)
|
||||||
cloudfiles (1.4.10)
|
cloudfiles (1.4.10)
|
||||||
mime-types (>= 1.16)
|
mime-types (>= 1.16)
|
||||||
columnize (0.3.2)
|
columnize (0.3.4)
|
||||||
configuration (1.2.0)
|
configuration (1.3.1)
|
||||||
crack (0.1.8)
|
crack (0.1.8)
|
||||||
cucumber (0.10.3)
|
cucumber (1.0.1)
|
||||||
builder (>= 2.1.2)
|
builder (>= 2.1.2)
|
||||||
diff-lcs (>= 1.1.2)
|
diff-lcs (>= 1.1.2)
|
||||||
gherkin (>= 2.3.8)
|
gherkin (~> 2.4.5)
|
||||||
json (>= 1.4.6)
|
json (>= 1.4.6)
|
||||||
term-ansicolor (>= 1.0.5)
|
term-ansicolor (>= 1.0.5)
|
||||||
cucumber-rails (0.3.2)
|
cucumber-rails (0.3.2)
|
||||||
cucumber (>= 0.8.0)
|
cucumber (>= 0.8.0)
|
||||||
culerity (0.2.15)
|
culerity (0.2.15)
|
||||||
daemons (1.1.3)
|
daemons (1.1.4)
|
||||||
database_cleaner (0.6.0)
|
database_cleaner (0.6.0)
|
||||||
devise (1.3.4)
|
devise (1.3.4)
|
||||||
bcrypt-ruby (~> 2.1.2)
|
bcrypt-ruby (~> 2.1.2)
|
||||||
|
|
@ -183,9 +183,9 @@ GEM
|
||||||
addressable (~> 2.2.4)
|
addressable (~> 2.2.4)
|
||||||
multipart-post (~> 1.1.0)
|
multipart-post (~> 1.1.0)
|
||||||
rack (< 2, >= 1.1.0)
|
rack (< 2, >= 1.1.0)
|
||||||
faraday-stack (0.1.2)
|
faraday-stack (0.1.3)
|
||||||
faraday (~> 0.6)
|
faraday (~> 0.6)
|
||||||
faraday_middleware (0.6.3)
|
faraday_middleware (0.6.5)
|
||||||
faraday (~> 0.6.0)
|
faraday (~> 0.6.0)
|
||||||
fastercsv (1.5.4)
|
fastercsv (1.5.4)
|
||||||
fastthread (1.0.7)
|
fastthread (1.0.7)
|
||||||
|
|
@ -201,19 +201,19 @@ GEM
|
||||||
nokogiri (~> 1.4.3.1)
|
nokogiri (~> 1.4.3.1)
|
||||||
ruby-hmac
|
ruby-hmac
|
||||||
foreigner (0.9.1)
|
foreigner (0.9.1)
|
||||||
formatador (0.1.4)
|
formatador (0.1.5)
|
||||||
fuubar (0.0.5)
|
fuubar (0.0.5)
|
||||||
rspec (~> 2.0)
|
rspec (~> 2.0)
|
||||||
rspec-instafail (~> 0.1.4)
|
rspec-instafail (~> 0.1.4)
|
||||||
ruby-progressbar (~> 0.0.10)
|
ruby-progressbar (~> 0.0.10)
|
||||||
gem_plugin (0.2.3)
|
gem_plugin (0.2.3)
|
||||||
gherkin (2.3.10)
|
gherkin (2.4.5)
|
||||||
json (>= 1.4.6)
|
json (>= 1.4.6)
|
||||||
haml (3.0.25)
|
haml (3.1.2)
|
||||||
hashie (1.0.0)
|
hashie (1.0.0)
|
||||||
highline (1.6.2)
|
highline (1.6.2)
|
||||||
http_connection (1.4.1)
|
http_connection (1.4.1)
|
||||||
i18n (0.6.0)
|
i18n (0.5.0)
|
||||||
i18n-inflector (2.6.1)
|
i18n-inflector (2.6.1)
|
||||||
i18n (>= 0.4.1)
|
i18n (>= 0.4.1)
|
||||||
i18n-inflector-rails (1.0.4)
|
i18n-inflector-rails (1.0.4)
|
||||||
|
|
@ -267,7 +267,7 @@ GEM
|
||||||
net-ssh (2.0.24)
|
net-ssh (2.0.24)
|
||||||
net-ssh-gateway (1.1.0)
|
net-ssh-gateway (1.1.0)
|
||||||
net-ssh (>= 1.99.1)
|
net-ssh (>= 1.99.1)
|
||||||
newrelic_rpm (3.0.1)
|
newrelic_rpm (3.1.0)
|
||||||
nokogiri (1.4.3.1)
|
nokogiri (1.4.3.1)
|
||||||
oa-basic (0.2.6)
|
oa-basic (0.2.6)
|
||||||
oa-core (= 0.2.6)
|
oa-core (= 0.2.6)
|
||||||
|
|
@ -295,7 +295,7 @@ GEM
|
||||||
oa-core (= 0.2.6)
|
oa-core (= 0.2.6)
|
||||||
rack-openid (~> 1.3.1)
|
rack-openid (~> 1.3.1)
|
||||||
ruby-openid-apps-discovery (~> 1.2.0)
|
ruby-openid-apps-discovery (~> 1.2.0)
|
||||||
oauth (0.4.4)
|
oauth (0.4.5)
|
||||||
oauth2 (0.4.1)
|
oauth2 (0.4.1)
|
||||||
faraday (~> 0.6.1)
|
faraday (~> 0.6.1)
|
||||||
multi_json (>= 0.0.5)
|
multi_json (>= 0.0.5)
|
||||||
|
|
@ -316,7 +316,7 @@ GEM
|
||||||
oa-more (= 0.2.6)
|
oa-more (= 0.2.6)
|
||||||
oa-oauth (= 0.2.6)
|
oa-oauth (= 0.2.6)
|
||||||
oa-openid (= 0.2.6)
|
oa-openid (= 0.2.6)
|
||||||
open4 (1.0.1)
|
open4 (1.1.0)
|
||||||
orm_adapter (0.0.5)
|
orm_adapter (0.0.5)
|
||||||
polyglot (0.3.1)
|
polyglot (0.3.1)
|
||||||
pyu-ruby-sasl (0.0.3.3)
|
pyu-ruby-sasl (0.0.3.3)
|
||||||
|
|
@ -328,26 +328,28 @@ GEM
|
||||||
ruby-openid (>= 2.1.8)
|
ruby-openid (>= 2.1.8)
|
||||||
rack-test (0.5.7)
|
rack-test (0.5.7)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
rails (3.0.3)
|
rails (3.0.9)
|
||||||
actionmailer (= 3.0.3)
|
actionmailer (= 3.0.9)
|
||||||
actionpack (= 3.0.3)
|
actionpack (= 3.0.9)
|
||||||
activerecord (= 3.0.3)
|
activerecord (= 3.0.9)
|
||||||
activeresource (= 3.0.3)
|
activeresource (= 3.0.9)
|
||||||
activesupport (= 3.0.3)
|
activesupport (= 3.0.9)
|
||||||
bundler (~> 1.0)
|
bundler (~> 1.0)
|
||||||
railties (= 3.0.3)
|
railties (= 3.0.9)
|
||||||
rails-i18n (0.1.0)
|
rails-i18n (0.1.0)
|
||||||
activesupport (~> 3)
|
activesupport (~> 3)
|
||||||
railties (3.0.3)
|
railties (3.0.9)
|
||||||
actionpack (= 3.0.3)
|
actionpack (= 3.0.9)
|
||||||
activesupport (= 3.0.3)
|
activesupport (= 3.0.9)
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
|
rdoc (~> 3.4)
|
||||||
thor (~> 0.14.4)
|
thor (~> 0.14.4)
|
||||||
rake (0.9.2)
|
rake (0.9.2)
|
||||||
rash (0.3.0)
|
rash (0.3.0)
|
||||||
hashie (~> 1.0.0)
|
hashie (~> 1.0.0)
|
||||||
rcov (0.9.9)
|
rcov (0.9.9)
|
||||||
redis (2.2.0)
|
rdoc (3.8)
|
||||||
|
redis (2.2.1)
|
||||||
redis-namespace (0.8.0)
|
redis-namespace (0.8.0)
|
||||||
redis (< 3.0.0)
|
redis (< 3.0.0)
|
||||||
resque (1.10.0)
|
resque (1.10.0)
|
||||||
|
|
@ -367,7 +369,7 @@ GEM
|
||||||
rspec-core (2.6.0)
|
rspec-core (2.6.0)
|
||||||
rspec-expectations (2.6.0)
|
rspec-expectations (2.6.0)
|
||||||
diff-lcs (~> 1.1.2)
|
diff-lcs (~> 1.1.2)
|
||||||
rspec-instafail (0.1.7)
|
rspec-instafail (0.1.8)
|
||||||
rspec-mocks (2.6.0)
|
rspec-mocks (2.6.0)
|
||||||
rspec-rails (2.6.1)
|
rspec-rails (2.6.1)
|
||||||
actionpack (~> 3.0)
|
actionpack (~> 3.0)
|
||||||
|
|
@ -396,6 +398,7 @@ GEM
|
||||||
archive-tar-minitar (>= 0.5.2)
|
archive-tar-minitar (>= 0.5.2)
|
||||||
rubyntlm (0.1.1)
|
rubyntlm (0.1.1)
|
||||||
rubyzip (0.9.4)
|
rubyzip (0.9.4)
|
||||||
|
sass (3.1.4)
|
||||||
selenium-webdriver (0.2.2)
|
selenium-webdriver (0.2.2)
|
||||||
childprocess (>= 0.1.9)
|
childprocess (>= 0.1.9)
|
||||||
ffi (>= 1.0.7)
|
ffi (>= 1.0.7)
|
||||||
|
|
@ -439,8 +442,8 @@ GEM
|
||||||
addressable (>= 2.2.2)
|
addressable (>= 2.2.2)
|
||||||
crack (>= 0.1.7)
|
crack (>= 0.1.7)
|
||||||
will_paginate (3.0.pre2)
|
will_paginate (3.0.pre2)
|
||||||
xml-simple (1.0.16)
|
xml-simple (1.1.0)
|
||||||
yard (0.7.1)
|
yard (0.7.2)
|
||||||
yui-compressor (0.9.6)
|
yui-compressor (0.9.6)
|
||||||
POpen4 (>= 0.1.4)
|
POpen4 (>= 0.1.4)
|
||||||
|
|
||||||
|
|
@ -475,7 +478,7 @@ DEPENDENCIES
|
||||||
fog (= 0.3.25)
|
fog (= 0.3.25)
|
||||||
foreigner (= 0.9.1)
|
foreigner (= 0.9.1)
|
||||||
fuubar
|
fuubar
|
||||||
haml (= 3.0.25)
|
haml (= 3.1.2)
|
||||||
http_accept_language!
|
http_accept_language!
|
||||||
i18n-inflector-rails (~> 1.0)
|
i18n-inflector-rails (~> 1.0)
|
||||||
jammit (= 0.5.4)
|
jammit (= 0.5.4)
|
||||||
|
|
@ -492,7 +495,7 @@ DEPENDENCIES
|
||||||
oauth2-provider (= 0.0.16)
|
oauth2-provider (= 0.0.16)
|
||||||
ohai (= 0.5.8)
|
ohai (= 0.5.8)
|
||||||
omniauth (= 0.2.6)
|
omniauth (= 0.2.6)
|
||||||
rails (= 3.0.3)
|
rails (= 3.0.9)
|
||||||
rails-i18n
|
rails-i18n
|
||||||
rcov
|
rcov
|
||||||
resque (= 1.10.0)
|
resque (= 1.10.0)
|
||||||
|
|
@ -505,6 +508,7 @@ DEPENDENCIES
|
||||||
rspec-rails (>= 2.0.0)
|
rspec-rails (>= 2.0.0)
|
||||||
ruby-debug
|
ruby-debug
|
||||||
ruby-debug19
|
ruby-debug19
|
||||||
|
sass (= 3.1.4)
|
||||||
selenium-webdriver (= 0.2.2)
|
selenium-webdriver (= 0.2.2)
|
||||||
settingslogic (= 2.0.6)
|
settingslogic (= 2.0.6)
|
||||||
sod!
|
sod!
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
module MarkdownifyHelper
|
module MarkdownifyHelper
|
||||||
def markdownify(message, options={})
|
def markdownify(message, options={})
|
||||||
message = h(message).html_safe
|
message = h(message).to_str
|
||||||
|
|
||||||
options[:newlines] = true if !options.has_key?(:newlines)
|
options[:newlines] = true if !options.has_key?(:newlines)
|
||||||
options[:specialchars] = true if !options.has_key?(:specialchars)
|
options[:specialchars] = true if !options.has_key?(:specialchars)
|
||||||
|
|
@ -17,7 +17,7 @@ module MarkdownifyHelper
|
||||||
message = process_specialchars(message) if options[:specialchars]
|
message = process_specialchars(message) if options[:specialchars]
|
||||||
message = process_newlines(message) if options[:newlines]
|
message = process_newlines(message) if options[:newlines]
|
||||||
|
|
||||||
message
|
message.html_safe
|
||||||
end
|
end
|
||||||
|
|
||||||
def process_newlines(message)
|
def process_newlines(message)
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ class StatusMessage < Post
|
||||||
|
|
||||||
def format_mentions(text, opts = {})
|
def format_mentions(text, opts = {})
|
||||||
regex = /@\{([^;]+); ([^\}]+)\}/
|
regex = /@\{([^;]+); ([^\}]+)\}/
|
||||||
form_message = text.gsub(regex) do |matched_string|
|
form_message = text.to_str.gsub(regex) do |matched_string|
|
||||||
people = self.mentioned_people
|
people = self.mentioned_people
|
||||||
person = people.detect{ |p|
|
person = people.detect{ |p|
|
||||||
p.diaspora_handle == $~[2] unless p.nil?
|
p.diaspora_handle == $~[2] unless p.nil?
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,7 @@
|
||||||
|
|
||||||
#new_status_message_pane
|
#new_status_message_pane
|
||||||
.span-15.last
|
.span-15.last
|
||||||
#facebox_header
|
%h4
|
||||||
%h4
|
=t('bookmarklet.post_something')
|
||||||
=t('bookmarklet.post_something')
|
|
||||||
|
|
||||||
= render :partial => 'shared/publisher', :locals => { :aspect => :profile, :aspects_with_person => @aspects, :aspect_ids => @aspect_ids}
|
= render :partial => 'shared/publisher', :locals => { :aspect => :profile, :aspects_with_person => @aspects, :aspect_ids => @aspect_ids}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,13 +14,3 @@ AVAILABLE_LANGUAGE_CODES.each do |c|
|
||||||
I18n.fallbacks[c.to_sym] = [c.to_sym, DEFAULT_LANGUAGE.to_sym, :en]
|
I18n.fallbacks[c.to_sym] = [c.to_sym, DEFAULT_LANGUAGE.to_sym, :en]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Workaround for https://rails.lighthouseapp.com/projects/8994/tickets/5329-using-i18nwith_locale-in-actionmailer-raises-systemstackerror
|
|
||||||
module AbstractController
|
|
||||||
class I18nProxy
|
|
||||||
def initialize(i18n_config, lookup_context)
|
|
||||||
@i18n_config, @lookup_context = i18n_config, lookup_context
|
|
||||||
@i18n_config = @i18n_config.i18n_config if @i18n_config.respond_to?(:i18n_config)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ module Diaspora
|
||||||
return text if opts[:plain_text]
|
return text if opts[:plain_text]
|
||||||
text = ERB::Util.h(text) unless opts[:no_escape]
|
text = ERB::Util.h(text) unless opts[:no_escape]
|
||||||
regex = /(^|\s)#(#{VALID_TAG_BODY})/
|
regex = /(^|\s)#(#{VALID_TAG_BODY})/
|
||||||
form_message = text.gsub(regex) do |matched_string|
|
form_message = text.to_str.gsub(regex) do |matched_string|
|
||||||
"#{$~[1]}<a href=\"/tags/#{$~[2]}\" class=\"tag\">##{$~[2]}</a>"
|
"#{$~[1]}<a href=\"/tags/#{$~[2]}\" class=\"tag\">##{$~[2]}</a>"
|
||||||
end
|
end
|
||||||
form_message.html_safe
|
form_message.html_safe
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,16 @@ describe AdminsController do
|
||||||
AppConfig[:admins] = [@user.username]
|
AppConfig[:admins] = [@user.username]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'succeeds' do
|
||||||
|
get :admin_inviter, :identifier => 'bob@moms.com'
|
||||||
|
response.should be_redirect
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'does not die if you do it twice' do
|
||||||
|
get :admin_inviter, :identifier => 'bob@moms.com'
|
||||||
|
get :admin_inviter, :identifier => 'bob@moms.com'
|
||||||
|
response.should be_redirect
|
||||||
|
end
|
||||||
it 'invites a new user' do
|
it 'invites a new user' do
|
||||||
Invitation.should_receive(:create_invitee).with(:service => 'email', :identifier => 'bob@moms.com')
|
Invitation.should_receive(:create_invitee).with(:service => 'email', :identifier => 'bob@moms.com')
|
||||||
get :admin_inviter, :identifier => 'bob@moms.com'
|
get :admin_inviter, :identifier => 'bob@moms.com'
|
||||||
|
|
|
||||||
|
|
@ -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