Merge branch 'next-minor' into develop

This commit is contained in:
Benjamin Neff 2020-02-12 00:10:32 +01:00
commit 4139ae2549
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
35 changed files with 201 additions and 178 deletions

View file

@ -29,6 +29,9 @@ Although the chat was never enabled per default and was marked as experimental,
# 0.7.13.0 # 0.7.13.0
## Security
* Fixes [USN-4274-1](https://usn.ubuntu.com/4274-1/), a potential Denial-of-Service vulnerability in Nokogiri. [#8108](https://github.com/diaspora/diaspora/pull/8108)
## Refactor ## Refactor
* Set better example values for unicorn stdout/stderr log settings [#8058](https://github.com/diaspora/diaspora/pull/8058) * Set better example values for unicorn stdout/stderr log settings [#8058](https://github.com/diaspora/diaspora/pull/8058)
* Replace dependency on rails-assets.org with custom gems cache at gems.diasporafoundation.org [#8087](https://github.com/diaspora/diaspora/pull/8087) * Replace dependency on rails-assets.org with custom gems cache at gems.diasporafoundation.org [#8087](https://github.com/diaspora/diaspora/pull/8087)

14
Gemfile
View file

@ -2,7 +2,7 @@
source "https://rubygems.org" source "https://rubygems.org"
gem "rails", "5.1.7" gem "rails", "5.2.4.1"
# Legacy Rails features, remove me! # Legacy Rails features, remove me!
# responders (class level) # responders (class level)
@ -27,7 +27,7 @@ gem "yajl-ruby", "1.4.1"
# Authentication # Authentication
gem "devise", "4.6.1" gem "devise", "4.7.1"
gem "devise-two-factor", "3.0.3" gem "devise-two-factor", "3.0.3"
gem "devise_lastseenable", "0.0.6" gem "devise_lastseenable", "0.0.6"
gem "rqrcode", "0.10.1" gem "rqrcode", "0.10.1"
@ -55,7 +55,7 @@ gem "configurate", "0.3.1"
# Cross-origin resource sharing # Cross-origin resource sharing
gem "rack-cors", "1.0.3", require: "rack/cors" gem "rack-cors", "1.1.1", require: "rack/cors"
# CSS # CSS
@ -82,7 +82,7 @@ gem "activerecord-import", "1.0.2"
gem "carrierwave", "1.3.1" gem "carrierwave", "1.3.1"
gem "fog-aws", "3.5.1" gem "fog-aws", "3.5.1"
gem "mini_magick", "4.9.3" gem "mini_magick", "4.10.1"
# GUID generation # GUID generation
gem "uuid", "2.3.9" gem "uuid", "2.3.9"
@ -146,7 +146,7 @@ gem "leaflet-rails", "1.5.1"
# Parsing # Parsing
gem "nokogiri", "1.10.3" gem "nokogiri", "1.10.8"
gem "open_graph_reader", "0.7.0" # also update User-Agent in features/support/webmock.rb gem "open_graph_reader", "0.7.0" # also update User-Agent in features/support/webmock.rb
gem "redcarpet", "3.4.0" gem "redcarpet", "3.4.0"
gem "ruby-oembed", "0.12.0" gem "ruby-oembed", "0.12.0"
@ -158,7 +158,7 @@ gem "string-direction", "1.2.1"
# Security Headers # Security Headers
gem "secure_headers", "6.1.1" gem "secure_headers", "6.3.0"
# Services # Services
@ -201,7 +201,7 @@ gem "logging-rails", "0.6.0", require: "logging/rails"
# Reading and writing zip files # Reading and writing zip files
gem "rubyzip", "1.2.2", require: "zip" gem "rubyzip", "1.3.0", require: "zip"
# Prevent occasions where minitest is not bundled in # Prevent occasions where minitest is not bundled in
# packaged versions of ruby. See following issues/prs: # packaged versions of ruby. See following issues/prs:

View file

@ -2,25 +2,25 @@ GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
remote: https://gems.diasporafoundation.org/ remote: https://gems.diasporafoundation.org/
specs: specs:
actioncable (5.1.7) actioncable (5.2.4.1)
actionpack (= 5.1.7) actionpack (= 5.2.4.1)
nio4r (~> 2.0) nio4r (~> 2.0)
websocket-driver (~> 0.6.1) websocket-driver (>= 0.6.1)
actionmailer (5.1.7) actionmailer (5.2.4.1)
actionpack (= 5.1.7) actionpack (= 5.2.4.1)
actionview (= 5.1.7) actionview (= 5.2.4.1)
activejob (= 5.1.7) activejob (= 5.2.4.1)
mail (~> 2.5, >= 2.5.4) mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
actionpack (5.1.7) actionpack (5.2.4.1)
actionview (= 5.1.7) actionview (= 5.2.4.1)
activesupport (= 5.1.7) activesupport (= 5.2.4.1)
rack (~> 2.0) rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3) rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2) rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.1.7) actionview (5.2.4.1)
activesupport (= 5.1.7) activesupport (= 5.2.4.1)
builder (~> 3.1) builder (~> 3.1)
erubi (~> 1.4) erubi (~> 1.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
@ -28,18 +28,22 @@ GEM
active_model_serializers (0.9.7) active_model_serializers (0.9.7)
activemodel (>= 3.2) activemodel (>= 3.2)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
activejob (5.1.7) activejob (5.2.4.1)
activesupport (= 5.1.7) activesupport (= 5.2.4.1)
globalid (>= 0.3.6) globalid (>= 0.3.6)
activemodel (5.1.7) activemodel (5.2.4.1)
activesupport (= 5.1.7) activesupport (= 5.2.4.1)
activerecord (5.1.7) activerecord (5.2.4.1)
activemodel (= 5.1.7) activemodel (= 5.2.4.1)
activesupport (= 5.1.7) activesupport (= 5.2.4.1)
arel (~> 8.0) arel (>= 9.0)
activerecord-import (1.0.2) activerecord-import (1.0.2)
activerecord (>= 3.2) activerecord (>= 3.2)
activesupport (5.1.7) activestorage (5.2.4.1)
actionpack (= 5.2.4.1)
activerecord (= 5.2.4.1)
marcel (~> 0.3.1)
activesupport (5.2.4.1)
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2) i18n (>= 0.7, < 2)
minitest (~> 5.1) minitest (~> 5.1)
@ -53,7 +57,7 @@ GEM
addressable (2.6.0) addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0) public_suffix (>= 2.0.2, < 4.0)
aes_key_wrap (1.0.1) aes_key_wrap (1.0.1)
arel (8.0.0) arel (9.0.0)
asset_sync (2.7.0) asset_sync (2.7.0)
activemodel (>= 4.1.0) activemodel (>= 4.1.0)
fog-core fog-core
@ -77,7 +81,7 @@ GEM
sassc (>= 2.0.0) sassc (>= 2.0.0)
bootstrap-switch-rails (3.3.3) bootstrap-switch-rails (3.3.3)
buftok (0.2.0) buftok (0.2.0)
builder (3.2.3) builder (3.2.4)
byebug (11.0.1) byebug (11.0.1)
capybara (3.15.0) capybara (3.15.0)
addressable addressable
@ -131,7 +135,7 @@ GEM
compass (~> 1.0.0) compass (~> 1.0.0)
sass-rails (< 5.1) sass-rails (< 5.1)
sprockets (< 4.0) sprockets (< 4.0)
concurrent-ruby (1.1.5) concurrent-ruby (1.1.6)
configurate (0.3.1) configurate (0.3.1)
connection_pool (2.2.2) connection_pool (2.2.2)
coveralls (0.8.23) coveralls (0.8.23)
@ -142,7 +146,7 @@ GEM
tins (~> 1.6) tins (~> 1.6)
crack (0.4.3) crack (0.4.3)
safe_yaml (~> 1.0.0) safe_yaml (~> 1.0.0)
crass (1.0.4) crass (1.0.6)
cucumber (3.1.2) cucumber (3.1.2)
builder (>= 2.1.2) builder (>= 2.1.2)
cucumber-core (~> 3.2.0) cucumber-core (~> 3.2.0)
@ -169,10 +173,10 @@ GEM
cucumber-tag_expressions (1.1.1) cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1) cucumber-wire (0.0.1)
database_cleaner (1.7.0) database_cleaner (1.7.0)
devise (4.6.1) devise (4.7.1)
bcrypt (~> 3.0) bcrypt (~> 3.0)
orm_adapter (~> 0.1) orm_adapter (~> 0.1)
railties (>= 4.1.0, < 6.0) railties (>= 4.1.0)
responders responders
warden (~> 1.2.3) warden (~> 1.2.3)
devise-two-factor (3.0.3) devise-two-factor (3.0.3)
@ -206,7 +210,7 @@ GEM
entypo-rails (3.0.0) entypo-rails (3.0.0)
railties (>= 4.1, < 6) railties (>= 4.1, < 6)
equalizer (0.0.11) equalizer (0.0.11)
erubi (1.8.0) erubi (1.9.0)
eslintrb (2.1.0) eslintrb (2.1.0)
execjs execjs
multi_json (>= 1.3) multi_json (>= 1.3)
@ -215,7 +219,7 @@ GEM
tzinfo tzinfo
ethon (0.12.0) ethon (0.12.0)
ffi (>= 1.3.0) ffi (>= 1.3.0)
excon (0.64.0) excon (0.72.0)
execjs (2.7.0) execjs (2.7.0)
eye (0.10.0) eye (0.10.0)
celluloid (~> 0.17.3) celluloid (~> 0.17.3)
@ -325,7 +329,7 @@ GEM
mime-types (~> 3.0) mime-types (~> 3.0)
multi_xml (>= 0.5.2) multi_xml (>= 0.5.2)
httpclient (2.8.3) httpclient (2.8.3)
i18n (1.6.0) i18n (1.8.2)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
i18n-inflector (2.6.7) i18n-inflector (2.6.7)
i18n (>= 0.4.1) i18n (>= 0.4.1)
@ -354,7 +358,7 @@ GEM
rails (>= 4.0, < 6.0) rails (>= 4.0, < 6.0)
sprockets (>= 3.0.0) sprockets (>= 3.0.0)
json (2.2.0) json (2.2.0)
json-jwt (1.10.2) json-jwt (1.11.0)
activesupport (>= 4.2) activesupport (>= 4.2)
aes_key_wrap aes_key_wrap
bindata bindata
@ -381,7 +385,7 @@ GEM
multi_json (~> 1.10) multi_json (~> 1.10)
logging-rails (0.6.0) logging-rails (0.6.0)
logging (>= 1.8) logging (>= 1.8)
loofah (2.2.3) loofah (2.4.0)
crass (~> 1.0.2) crass (~> 1.0.2)
nokogiri (>= 1.5.9) nokogiri (>= 1.5.9)
lumberjack (1.0.13) lumberjack (1.0.13)
@ -389,6 +393,8 @@ GEM
systemu (~> 2.6.5) systemu (~> 2.6.5)
mail (2.7.1) mail (2.7.1)
mini_mime (>= 0.1.1) mini_mime (>= 0.1.1)
marcel (0.3.3)
mimemagic (~> 0.3.2)
markdown-it-html5-embed (1.0.0) markdown-it-html5-embed (1.0.0)
markerb (1.1.0) markerb (1.1.0)
memoizable (0.4.2) memoizable (0.4.2)
@ -397,10 +403,11 @@ GEM
mime-types (3.2.2) mime-types (3.2.2)
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
mime-types-data (3.2019.0331) mime-types-data (3.2019.0331)
mini_magick (4.9.3) mimemagic (0.3.4)
mini_mime (1.0.1) mini_magick (4.10.1)
mini_mime (1.0.2)
mini_portile2 (2.4.0) mini_portile2 (2.4.0)
minitest (5.11.3) minitest (5.14.0)
mobile-fu (1.4.0) mobile-fu (1.4.0)
rack-mobile-detect rack-mobile-detect
rails rails
@ -411,8 +418,8 @@ GEM
mysql2 (0.5.2) mysql2 (0.5.2)
naught (1.1.0) naught (1.1.0)
nenv (0.3.0) nenv (0.3.0)
nio4r (2.3.1) nio4r (2.5.2)
nokogiri (1.10.3) nokogiri (1.10.8)
mini_portile2 (~> 2.4.0) mini_portile2 (~> 2.4.0)
notiffany (0.1.1) notiffany (0.1.1)
nenv (~> 0.1) nenv (~> 0.1)
@ -493,8 +500,9 @@ GEM
pry (~> 0.10) pry (~> 0.10)
public_suffix (3.1.1) public_suffix (3.1.1)
raabro (1.1.6) raabro (1.1.6)
rack (2.0.7) rack (2.2.2)
rack-cors (1.0.3) rack-cors (1.1.1)
rack (>= 2.0.0)
rack-google-analytics (1.2.0) rack-google-analytics (1.2.0)
actionpack actionpack
activesupport activesupport
@ -514,17 +522,18 @@ GEM
rack rack
rack-test (1.1.0) rack-test (1.1.0)
rack (>= 1.0, < 3) rack (>= 1.0, < 3)
rails (5.1.7) rails (5.2.4.1)
actioncable (= 5.1.7) actioncable (= 5.2.4.1)
actionmailer (= 5.1.7) actionmailer (= 5.2.4.1)
actionpack (= 5.1.7) actionpack (= 5.2.4.1)
actionview (= 5.1.7) actionview (= 5.2.4.1)
activejob (= 5.1.7) activejob (= 5.2.4.1)
activemodel (= 5.1.7) activemodel (= 5.2.4.1)
activerecord (= 5.1.7) activerecord (= 5.2.4.1)
activesupport (= 5.1.7) activestorage (= 5.2.4.1)
activesupport (= 5.2.4.1)
bundler (>= 1.3.0) bundler (>= 1.3.0)
railties (= 5.1.7) railties (= 5.2.4.1)
sprockets-rails (>= 2.0.0) sprockets-rails (>= 2.0.0)
rails-assets-autosize (4.0.2) rails-assets-autosize (4.0.2)
rails-assets-backbone (1.3.3) rails-assets-backbone (1.3.3)
@ -568,23 +577,23 @@ GEM
rails-dom-testing (2.0.3) rails-dom-testing (2.0.3)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
nokogiri (>= 1.6) nokogiri (>= 1.6)
rails-html-sanitizer (1.0.4) rails-html-sanitizer (1.3.0)
loofah (~> 2.2, >= 2.2.2) loofah (~> 2.3)
rails-i18n (5.1.3) rails-i18n (5.1.3)
i18n (>= 0.7, < 2) i18n (>= 0.7, < 2)
railties (>= 5.0, < 6) railties (>= 5.0, < 6)
rails-timeago (2.17.1) rails-timeago (2.17.1)
actionpack (>= 3.1) actionpack (>= 3.1)
activesupport (>= 3.1) activesupport (>= 3.1)
railties (5.1.7) railties (5.2.4.1)
actionpack (= 5.1.7) actionpack (= 5.2.4.1)
activesupport (= 5.1.7) activesupport (= 5.2.4.1)
method_source method_source
rake (>= 0.8.7) rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0) thor (>= 0.19.0, < 2.0)
rainbow (3.0.0) rainbow (3.0.0)
raindrops (0.19.0) raindrops (0.19.0)
rake (12.3.2) rake (12.3.3)
rb-fsevent (0.10.3) rb-fsevent (0.10.3)
rb-inotify (0.10.0) rb-inotify (0.10.0)
ffi (~> 1.0) ffi (~> 1.0)
@ -634,7 +643,7 @@ GEM
ruby-oembed (0.12.0) ruby-oembed (0.12.0)
ruby-progressbar (1.10.1) ruby-progressbar (1.10.1)
ruby_dep (1.5.0) ruby_dep (1.5.0)
rubyzip (1.2.2) rubyzip (1.3.0)
rugged (0.28.2) rugged (0.28.2)
safe_yaml (1.0.5) safe_yaml (1.0.5)
sass (3.4.25) sass (3.4.25)
@ -653,7 +662,7 @@ GEM
scss_lint (0.55.0) scss_lint (0.55.0)
rake (>= 0.9, < 13) rake (>= 0.9, < 13)
sass (~> 3.4.20) sass (~> 3.4.20)
secure_headers (6.1.1) secure_headers (6.3.0)
shellany (0.0.1) shellany (0.0.1)
shoulda-matchers (4.0.1) shoulda-matchers (4.0.1)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
@ -729,7 +738,7 @@ GEM
unf (~> 0.1.0) unf (~> 0.1.0)
typhoeus (1.3.1) typhoeus (1.3.1)
ethon (>= 0.9.0) ethon (>= 0.9.0)
tzinfo (1.2.5) tzinfo (1.2.6)
thread_safe (~> 0.1) thread_safe (~> 0.1)
uglifier (4.1.20) uglifier (4.1.20)
execjs (>= 0.3.0, < 3) execjs (>= 0.3.0, < 3)
@ -765,7 +774,7 @@ GEM
addressable (>= 2.3.6) addressable (>= 2.3.6)
crack (>= 0.3.2) crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0) hashdiff (>= 0.4.0, < 2.0.0)
websocket-driver (0.6.5) websocket-driver (0.7.1)
websocket-extensions (>= 0.1.0) websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.4) websocket-extensions (0.1.4)
will_paginate (3.1.7) will_paginate (3.1.7)
@ -795,7 +804,7 @@ DEPENDENCIES
cucumber-api-steps (= 0.14) cucumber-api-steps (= 0.14)
cucumber-rails (= 1.7.0) cucumber-rails (= 1.7.0)
database_cleaner (= 1.7.0) database_cleaner (= 1.7.0)
devise (= 4.6.1) devise (= 4.7.1)
devise-two-factor (= 3.0.3) devise-two-factor (= 3.0.3)
devise_lastseenable (= 0.0.6) devise_lastseenable (= 0.0.6)
diaspora_federation-json_schema (= 0.2.6) diaspora_federation-json_schema (= 0.2.6)
@ -831,11 +840,11 @@ DEPENDENCIES
logging-rails (= 0.6.0) logging-rails (= 0.6.0)
markdown-it-html5-embed (= 1.0.0) markdown-it-html5-embed (= 1.0.0)
markerb (= 1.1.0) markerb (= 1.1.0)
mini_magick (= 4.9.3) mini_magick (= 4.10.1)
minitest minitest
mobile-fu (= 1.4.0) mobile-fu (= 1.4.0)
mysql2 (= 0.5.2) mysql2 (= 0.5.2)
nokogiri (= 1.10.3) nokogiri (= 1.10.8)
omniauth (= 1.9.0) omniauth (= 1.9.0)
omniauth-tumblr (= 1.2) omniauth-tumblr (= 1.2)
omniauth-twitter (= 1.4.0) omniauth-twitter (= 1.4.0)
@ -851,12 +860,12 @@ DEPENDENCIES
pronto-scss (= 0.10.0) pronto-scss (= 0.10.0)
pry pry
pry-byebug pry-byebug
rack-cors (= 1.0.3) rack-cors (= 1.1.1)
rack-google-analytics (= 1.2.0) rack-google-analytics (= 1.2.0)
rack-piwik (= 0.3.0) rack-piwik (= 0.3.0)
rack-rewrite (= 1.5.1) rack-rewrite (= 1.5.1)
rack-ssl (= 1.4.1) rack-ssl (= 1.4.1)
rails (= 5.1.7) rails (= 5.2.4.1)
rails-assets-autosize (= 4.0.2)! rails-assets-autosize (= 4.0.2)!
rails-assets-backbone (= 1.3.3)! rails-assets-backbone (= 1.3.3)!
rails-assets-blueimp-gallery (= 2.33.0)! rails-assets-blueimp-gallery (= 2.33.0)!
@ -894,9 +903,9 @@ DEPENDENCIES
rubocop (= 0.72.0) rubocop (= 0.72.0)
rubocop-rails (= 2.1.0) rubocop-rails (= 2.1.0)
ruby-oembed (= 0.12.0) ruby-oembed (= 0.12.0)
rubyzip (= 1.2.2) rubyzip (= 1.3.0)
sass-rails (= 5.0.7) sass-rails (= 5.0.7)
secure_headers (= 6.1.1) secure_headers (= 6.3.0)
shoulda-matchers (= 4.0.1) shoulda-matchers (= 4.0.1)
sidekiq (= 5.2.7) sidekiq (= 5.2.7)
sidekiq-cron (= 1.1.0) sidekiq-cron (= 1.1.0)

View file

@ -51,7 +51,11 @@ class AdminsController < Admin::AdminController
end end
def stats def stats
@popular_tags = ActsAsTaggableOn::Tagging.joins(:tag).limit(50).order('count(taggings.id) DESC').group(:tag).count @popular_tags = ActsAsTaggableOn::Tagging.joins(:tag)
.limit(50)
.order(Arel.sql("count(taggings.id) DESC"))
.group(:tag)
.count
case params[:range] case params[:range]
when "week" when "week"
@ -72,7 +76,10 @@ class AdminsController < Admin::AdminController
create_hash(model, :range => range) create_hash(model, :range => range)
end end
@posts_per_day = Post.where("created_at >= ?", Date.today - 21.days).group("DATE(created_at)").order("DATE(created_at) ASC").count @posts_per_day = Post.where("created_at >= ?", Time.zone.today - 21.days)
.group(Arel.sql("DATE(created_at)"))
.order(Arel.sql("DATE(created_at) ASC"))
.count
@most_posts_within = @posts_per_day.values.max.to_f @most_posts_within = @posts_per_day.values.max.to_f
@user_count = User.count @user_count = User.count

View file

@ -104,8 +104,9 @@ module Api
end end
def handle_start_point_response(endpoint) def handle_start_point_response(endpoint)
_status, header, response = endpoint.call(request.env) status, header, _response = endpoint.call(request.env)
if response.redirect?
if status.in?([301, 302, 303, 307, 308])
redirect_to header["Location"] redirect_to header["Location"]
else else
save_params_and_render_consent_form(endpoint) save_params_and_render_consent_form(endpoint)

View file

@ -66,7 +66,7 @@ class ContactsController < ApplicationController
when "receiving" when "receiving"
current_user.contacts.receiving current_user.contacts.receiving
when "by_aspect" when "by_aspect"
order.unshift "contact_id IS NOT NULL DESC" order.unshift Arel.sql("contact_id IS NOT NULL DESC")
contacts_by_aspect(@aspect.id) contacts_by_aspect(@aspect.id)
else else
raise ArgumentError, "unknown type #{type}" raise ArgumentError, "unknown type #{type}"

View file

@ -164,7 +164,7 @@ class Person < ApplicationRecord
contacts.id IS NOT NULL AS is_contact contacts.id IS NOT NULL AS is_contact
SQL SQL
) )
.order(<<-SQL .order(Arel.sql(<<-SQL
is_author DESC, is_author DESC,
is_commenter DESC, is_commenter DESC,
is_liker DESC, is_liker DESC,
@ -172,7 +172,7 @@ class Person < ApplicationRecord
profiles.full_name, profiles.full_name,
people.diaspora_handle people.diaspora_handle
SQL SQL
) ))
} }
def self.community_spotlight def self.community_spotlight
@ -187,6 +187,8 @@ class Person < ApplicationRecord
# end # end
# will not work! The nil profile will be overriden with an empty one. # will not work! The nil profile will be overriden with an empty one.
def initialize(params={}) def initialize(params={})
params = {} if params.nil?
profile_set = params.has_key?(:profile) || params.has_key?("profile") profile_set = params.has_key?(:profile) || params.has_key?("profile")
params[:profile_attributes] = params.delete(:profile) if params.has_key?(:profile) && params[:profile].is_a?(Hash) params[:profile_attributes] = params.delete(:profile) if params.has_key?(:profile) && params[:profile].is_a?(Hash)
super super
@ -209,7 +211,7 @@ class Person < ApplicationRecord
self.guid self.guid
end end
private_class_method def self.search_query_string(query) def self.search_query_string(query)
query = query.downcase query = query.downcase
like_operator = AppConfig.postgres? ? "ILIKE" : "LIKE" like_operator = AppConfig.postgres? ? "ILIKE" : "LIKE"
@ -241,7 +243,7 @@ class Person < ApplicationRecord
query = query.where(contacts: {sharing: true, receiving: true}) if mutual query = query.where(contacts: {sharing: true, receiving: true}) if mutual
query.where(closed_account: false) query.where(closed_account: false)
.order(["contacts.user_id IS NULL", "profiles.last_name ASC", "profiles.first_name ASC"]) .order([Arel.sql("contacts.user_id IS NULL"), "profiles.last_name ASC", "profiles.first_name ASC"])
end end
def name(opts = {}) def name(opts = {})

View file

@ -29,7 +29,7 @@ class AspectsMembershipService
end end
def contacts_in_aspect(aspect_id) def contacts_in_aspect(aspect_id)
order = ["contact_id IS NOT NULL DESC", "profiles.first_name ASC", "profiles.last_name ASC", order = [Arel.sql("contact_id IS NOT NULL DESC"), "profiles.first_name ASC", "profiles.last_name ASC",
"profiles.diaspora_handle ASC"] "profiles.diaspora_handle ASC"]
@user.aspects.find(aspect_id) # to provide better error code if aspect isn't correct @user.aspects.find(aspect_id) # to provide better error code if aspect isn't correct
contacts = @user.contacts.arel_table contacts = @user.contacts.arel_table

View file

@ -22,12 +22,12 @@ class LikeService
def find_for_post(post_id) def find_for_post(post_id)
likes = post_service.find!(post_id).likes likes = post_service.find!(post_id).likes
user ? likes.order("author_id = #{user.person.id} DESC") : likes user ? likes.order(Arel.sql("author_id = #{user.person.id} DESC")) : likes
end end
def unlike_post(post_id) def unlike_post(post_id)
likes = post_service.find!(post_id).likes likes = post_service.find!(post_id).likes
likes = likes.order("author_id = #{user.person.id} DESC") likes = likes.order(Arel.sql("author_id = #{user.person.id} DESC"))
if !likes.empty? && user.owns?(likes[0]) if !likes.empty? && user.owns?(likes[0])
user.retract(likes[0]) user.retract(likes[0])
true true

View file

@ -13,7 +13,7 @@ class ReshareService
def find_for_post(post_id) def find_for_post(post_id)
reshares = post_service.find!(post_id).reshares reshares = post_service.find!(post_id).reshares
user ? reshares.order("author_id = #{user.person.id} DESC") : reshares user ? reshares.order(Arel.sql("author_id = #{user.person.id} DESC")) : reshares
end end
private private

View file

@ -2,7 +2,7 @@
-# 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.
%script{nonce: content_security_policy_nonce(:script)} %script{nonce: content_security_policy_script_nonce}
:plain :plain
$(document).ready(function () { $(document).ready(function () {
var data = $.parseJSON( "#{escape_javascript(@contacts_json).html_safe}" ), var data = $.parseJSON( "#{escape_javascript(@contacts_json).html_safe}" ),

View file

@ -21,7 +21,7 @@
= stylesheet_link_tag :poltergeist_disable_transition, media: "all" = stylesheet_link_tag :poltergeist_disable_transition, media: "all"
= jquery_include_tag = jquery_include_tag
= include_gon(camel_case: true, nonce: content_security_policy_nonce(:script)) = include_gon(camel_case: true, nonce: content_security_policy_script_nonce)
= yield(:javascript) = yield(:javascript)
= csrf_meta_tag = csrf_meta_tag

View file

@ -1,3 +1,3 @@
# frozen_string_literal: true # frozen_string_literal: true
Rails.application.config.secret_token = AppConfig.secret_token Rails.application.config.secret_key_base = AppConfig.secret_token

View file

@ -35,11 +35,12 @@ module Diaspora
def append_and_truncate def append_and_truncate
if options[:truncate] if options[:truncate]
@message = message.truncate options[:truncate]-options[:append].to_s.size # TODO: Remove .dup when upgrading to Rails 6.x.
@message = @message.truncate(options[:truncate] - options[:append].to_s.size).dup
end end
message << options[:append].to_s @message << options[:append].to_s
message << options[:append_after_truncate].to_s @message << options[:append_after_truncate].to_s
end end
def escape def escape

View file

@ -30,7 +30,7 @@ describe AdminsController, :type => :controller do
it "succeeds" do it "succeeds" do
get :dashboard get :dashboard
expect(response).to be_success expect(response).to be_successful
end end
it "warns the user about unreviewed reports" do it "warns the user about unreviewed reports" do
@ -62,7 +62,7 @@ describe AdminsController, :type => :controller do
it 'succeeds and renders user_search' do it 'succeeds and renders user_search' do
get :user_search get :user_search
expect(response).to be_success expect(response).to be_successful
expect(response).to render_template(:user_search) expect(response).to render_template(:user_search)
end end
@ -139,7 +139,7 @@ describe AdminsController, :type => :controller do
it "succeeds and renders stats" do it "succeeds and renders stats" do
get :stats get :stats
expect(response).to be_success expect(response).to be_successful
expect(response).to render_template(:stats) expect(response).to render_template(:stats)
expect(response.body).to include( expect(response.body).to include(
I18n.translate( I18n.translate(
@ -151,7 +151,7 @@ describe AdminsController, :type => :controller do
it "succeeds and renders stats for different ranges" do it "succeeds and renders stats for different ranges" do
%w(week 2weeks month).each do |range| %w(week 2weeks month).each do |range|
get :stats, params: {range: range} get :stats, params: {range: range}
expect(response).to be_success expect(response).to be_successful
expect(response).to render_template(:stats) expect(response).to render_template(:stats)
expect(response.body).not_to include( expect(response.body).not_to include(
I18n.translate( I18n.translate(

View file

@ -25,7 +25,7 @@ describe AspectMembershipsController, type: :controller do
it "succeeds" do it "succeeds" do
post :create, params: {person_id: bob.person.id, aspect_id: @aspect1.id}, format: :json post :create, params: {person_id: bob.person.id, aspect_id: @aspect1.id}, format: :json
expect(response).to be_success expect(response).to be_successful
end end
it "creates an aspect membership" do it "creates an aspect membership" do
@ -75,14 +75,14 @@ describe AspectMembershipsController, type: :controller do
it "removes contacts from an aspect" do it "removes contacts from an aspect" do
membership = alice.add_contact_to_aspect(@contact, @aspect1) membership = alice.add_contact_to_aspect(@contact, @aspect1)
delete :destroy, params: {id: membership.id}, format: :json delete :destroy, params: {id: membership.id}, format: :json
expect(response).to be_success expect(response).to be_successful
@aspect1.reload @aspect1.reload
expect(@aspect1.contacts.to_a).not_to include @contact expect(@aspect1.contacts.to_a).not_to include @contact
end end
it "aspect membership does not exist" do it "aspect membership does not exist" do
delete :destroy, params: {id: 123}, format: :json delete :destroy, params: {id: 123}, format: :json
expect(response).not_to be_success expect(response).not_to be_successful
expect(response.body).to eq(I18n.t("aspect_memberships.destroy.no_membership")) expect(response.body).to eq(I18n.t("aspect_memberships.destroy.no_membership"))
end end
end end

View file

@ -29,7 +29,7 @@ describe CommentsController, :type => :controller do
it 'responds to format mobile' do it 'responds to format mobile' do
post :create, params: comment_hash, format: :mobile post :create, params: comment_hash, format: :mobile
expect(response).to be_success expect(response).to be_successful
end end
end end
@ -136,7 +136,7 @@ describe CommentsController, :type => :controller do
it 'works for mobile' do it 'works for mobile' do
get :index, params: {post_id: @message.id}, format: :mobile get :index, params: {post_id: @message.id}, format: :mobile
expect(response).to be_success expect(response).to be_successful
end end
it 'returns all the comments for a post' do it 'returns all the comments for a post' do

View file

@ -14,14 +14,14 @@ describe ContactsController, :type => :controller do
context 'format mobile' do context 'format mobile' do
it "succeeds" do it "succeeds" do
get :index, format: :mobile get :index, format: :mobile
expect(response).to be_success expect(response).to be_successful
end end
end end
context 'format html' do context 'format html' do
it "succeeds" do it "succeeds" do
get :index get :index
expect(response).to be_success expect(response).to be_successful
end end
it "doesn't assign contacts" do it "doesn't assign contacts" do
@ -43,7 +43,7 @@ describe ContactsController, :type => :controller do
it "succeeds" do it "succeeds" do
get :index, params: {q: @person1.first_name}, format: :json get :index, params: {q: @person1.first_name}, format: :json
expect(response).to be_success expect(response).to be_successful
end end
it "responds with json" do it "responds with json" do
@ -133,7 +133,7 @@ describe ContactsController, :type => :controller do
describe '#spotlight' do describe '#spotlight' do
it 'succeeds' do it 'succeeds' do
get :spotlight get :spotlight
expect(response).to be_success expect(response).to be_successful
end end
it 'gets queries for users in the app config' do it 'gets queries for users in the app config' do

View file

@ -20,7 +20,7 @@ describe ConversationsController, :type => :controller do
context "desktop" do context "desktop" do
it "succeeds" do it "succeeds" do
get :new, params: {modal: true} get :new, params: {modal: true}
expect(response).to be_success expect(response).to be_successful
end end
end end
@ -76,13 +76,13 @@ describe ConversationsController, :type => :controller do
it "succeeds" do it "succeeds" do
get :index get :index
expect(response).to be_success expect(response).to be_successful
expect(assigns[:visibilities]).to match_array(@visibilities) expect(assigns[:visibilities]).to match_array(@visibilities)
end end
it "succeeds with json" do it "succeeds with json" do
get :index, format: :json get :index, format: :json
expect(response).to be_success expect(response).to be_successful
json = JSON.parse(response.body) json = JSON.parse(response.body)
expect(json.first["conversation"]).to be_present expect(json.first["conversation"]).to be_present
end end
@ -94,7 +94,7 @@ describe ConversationsController, :type => :controller do
it "retrieves a conversation" do it "retrieves a conversation" do
get :index, params: {conversation_id: @conversations.first.id} get :index, params: {conversation_id: @conversations.first.id}
expect(response).to be_success expect(response).to be_successful
expect(assigns[:visibilities]).to match_array(@visibilities) expect(assigns[:visibilities]).to match_array(@visibilities)
expect(assigns[:conversation]).to eq(@conversations.first) expect(assigns[:conversation]).to eq(@conversations.first)
end end
@ -108,7 +108,7 @@ describe ConversationsController, :type => :controller do
it "retrieves a conversation message with out markdown content " do it "retrieves a conversation message with out markdown content " do
get :index get :index
@conversation = @conversations.first @conversation = @conversations.first
expect(response).to be_success expect(response).to be_successful
expect(response.body).to match(/cool stuff/) expect(response.body).to match(/cool stuff/)
expect(response.body).not_to match(%r{<strong>cool stuff</strong>}) expect(response.body).not_to match(%r{<strong>cool stuff</strong>})
end end
@ -134,7 +134,7 @@ describe ConversationsController, :type => :controller do
it "responds with the conversation id as JSON" do it "responds with the conversation id as JSON" do
post :create, params: params, format: :js post :create, params: params, format: :js
expect(response).to be_success expect(response).to be_successful
expect(JSON.parse(response.body)["id"]).to eq(Conversation.first.id) expect(JSON.parse(response.body)["id"]).to eq(Conversation.first.id)
end end
@ -172,7 +172,7 @@ describe ConversationsController, :type => :controller do
it "responds with the conversation id as JSON" do it "responds with the conversation id as JSON" do
post :create, params: params, format: :js post :create, params: params, format: :js
expect(response).to be_success expect(response).to be_successful
expect(JSON.parse(response.body)["id"]).to eq(Conversation.first.id) expect(JSON.parse(response.body)["id"]).to eq(Conversation.first.id)
end end
end end
@ -195,7 +195,7 @@ describe ConversationsController, :type => :controller do
it "responds with an error message" do it "responds with an error message" do
post :create, params: params, format: :js post :create, params: params, format: :js
expect(response).not_to be_success expect(response).not_to be_successful
expect(response.body).to eq(I18n.t("conversations.create.fail")) expect(response.body).to eq(I18n.t("conversations.create.fail"))
end end
end end
@ -218,7 +218,7 @@ describe ConversationsController, :type => :controller do
it "responds with an error message" do it "responds with an error message" do
post :create, params: params, format: :js post :create, params: params, format: :js
expect(response).not_to be_success expect(response).not_to be_successful
expect(response.body).to eq(I18n.t("javascripts.conversation.create.no_recipient")) expect(response.body).to eq(I18n.t("javascripts.conversation.create.no_recipient"))
end end
end end
@ -241,7 +241,7 @@ describe ConversationsController, :type => :controller do
it "responds with an error message" do it "responds with an error message" do
post :create, params: params, format: :js post :create, params: params, format: :js
expect(response).not_to be_success expect(response).not_to be_successful
expect(response.body).to eq(I18n.t("javascripts.conversation.create.no_recipient")) expect(response.body).to eq(I18n.t("javascripts.conversation.create.no_recipient"))
end end
end end
@ -272,7 +272,7 @@ describe ConversationsController, :type => :controller do
it "responds with an error message" do it "responds with an error message" do
post :create, params: params, format: :js post :create, params: params, format: :js
expect(response).not_to be_success expect(response).not_to be_successful
expect(response.body).to eq(I18n.t("javascripts.conversation.create.no_recipient")) expect(response.body).to eq(I18n.t("javascripts.conversation.create.no_recipient"))
end end
end end
@ -301,7 +301,7 @@ describe ConversationsController, :type => :controller do
it "responds with the conversation id as JSON" do it "responds with the conversation id as JSON" do
post :create, params: params, format: :js post :create, params: params, format: :js
expect(response).to be_success expect(response).to be_successful
expect(JSON.parse(response.body)["id"]).to eq(Conversation.first.id) expect(JSON.parse(response.body)["id"]).to eq(Conversation.first.id)
end end
@ -339,7 +339,7 @@ describe ConversationsController, :type => :controller do
it "responds with the conversation id as JSON" do it "responds with the conversation id as JSON" do
post :create, params: params, format: :js post :create, params: params, format: :js
expect(response).to be_success expect(response).to be_successful
expect(JSON.parse(response.body)["id"]).to eq(Conversation.first.id) expect(JSON.parse(response.body)["id"]).to eq(Conversation.first.id)
end end
end end
@ -362,7 +362,7 @@ describe ConversationsController, :type => :controller do
it "responds with an error message" do it "responds with an error message" do
post :create, params: params, format: :js post :create, params: params, format: :js
expect(response).not_to be_success expect(response).not_to be_successful
expect(response.body).to eq(I18n.t("conversations.create.fail")) expect(response.body).to eq(I18n.t("conversations.create.fail"))
end end
end end
@ -385,7 +385,7 @@ describe ConversationsController, :type => :controller do
it "responds with an error message" do it "responds with an error message" do
post :create, params: params, format: :js post :create, params: params, format: :js
expect(response).not_to be_success expect(response).not_to be_successful
expect(response.body).to eq(I18n.t("javascripts.conversation.create.no_recipient")) expect(response.body).to eq(I18n.t("javascripts.conversation.create.no_recipient"))
end end
end end
@ -408,7 +408,7 @@ describe ConversationsController, :type => :controller do
it "responds with an error message" do it "responds with an error message" do
post :create, params: params, format: :js post :create, params: params, format: :js
expect(response).not_to be_success expect(response).not_to be_successful
expect(response.body).to eq(I18n.t("javascripts.conversation.create.no_recipient")) expect(response.body).to eq(I18n.t("javascripts.conversation.create.no_recipient"))
end end
end end
@ -433,7 +433,7 @@ describe ConversationsController, :type => :controller do
it "responds with an error message" do it "responds with an error message" do
post :create, params: params, format: :js post :create, params: params, format: :js
expect(response).not_to be_success expect(response).not_to be_successful
expect(response.body).to eq(I18n.t("javascripts.conversation.create.no_recipient")) expect(response.body).to eq(I18n.t("javascripts.conversation.create.no_recipient"))
end end
end end
@ -452,7 +452,7 @@ describe ConversationsController, :type => :controller do
it "succeeds with json" do it "succeeds with json" do
get :show, params: {id: conversation.id}, format: :json get :show, params: {id: conversation.id}, format: :json
expect(response).to be_success expect(response).to be_successful
expect(assigns[:conversation]).to eq(conversation) expect(assigns[:conversation]).to eq(conversation)
expect(response.body).to include conversation.guid expect(response.body).to include conversation.guid
end end

View file

@ -4,7 +4,7 @@ describe HelpController, type: :controller do
describe "#faq" do describe "#faq" do
it "succeeds" do it "succeeds" do
get :faq get :faq
expect(response).to be_success expect(response).to be_successful
end end
it "fails on mobile" do it "fails on mobile" do

View file

@ -33,12 +33,12 @@ describe HomeController, type: :controller do
describe "#podmin" do describe "#podmin" do
it "succeeds" do it "succeeds" do
get :podmin get :podmin
expect(response).to be_success expect(response).to be_successful
end end
it "succeeds on mobile" do it "succeeds on mobile" do
get :podmin, format: :mobile get :podmin, format: :mobile
expect(response).to be_success expect(response).to be_successful
end end
end end

View file

@ -54,7 +54,7 @@ TXT
Timecop.travel(time) do Timecop.travel(time) do
get :multi, :format => :json get :multi, :format => :json
expect(response).to be_success expect(response).to be_successful
save_fixture(response.body, "stream_json") save_fixture(response.body, "stream_json")
end end
end end

View file

@ -5,7 +5,7 @@ describe NodeInfoController do
it "responds to JSON" do it "responds to JSON" do
get :jrd, format: :json get :jrd, format: :json
expect(response).to be_success expect(response).to be_successful
end end
it "returns a JRD" do it "returns a JRD" do
@ -38,7 +38,7 @@ describe NodeInfoController do
it "responds to JSON" do it "responds to JSON" do
get :document, params: {version: version}, format: :json get :document, params: {version: version}, format: :json
expect(response).to be_success expect(response).to be_successful
end end
it "calls NodeInfoPresenter" do it "calls NodeInfoPresenter" do

View file

@ -37,7 +37,7 @@ describe NotificationsController, :type => :controller do
end end
get :update, params: {id: note.id, set_unread: "true"}, format: :json get :update, params: {id: note.id, set_unread: "true"}, format: :json
expect(response).to be_success expect(response).to be_successful
updated_note = Notification.find(note.id) updated_note = Notification.find(note.id)
expect(updated_note.unread).to eq(true) expect(updated_note.unread).to eq(true)
@ -64,7 +64,7 @@ describe NotificationsController, :type => :controller do
it 'succeeds' do it 'succeeds' do
get :index get :index
expect(response).to be_success expect(response).to be_successful
expect(assigns[:notifications].count).to eq(1) expect(assigns[:notifications].count).to eq(1)
end end
@ -73,7 +73,7 @@ describe NotificationsController, :type => :controller do
@notification.touch @notification.touch
end end
get :index, format: :json get :index, format: :json
expect(response).to be_success expect(response).to be_successful
response_json = JSON.parse(response.body) response_json = JSON.parse(response.body)
note_html = Nokogiri::HTML(response_json["notification_list"][0]["also_commented"]["note_html"]) note_html = Nokogiri::HTML(response_json["notification_list"][0]["also_commented"]["note_html"])
timeago_content = note_html.css("time")[0]["data-time-ago"] timeago_content = note_html.css("time")[0]["data-time-ago"]
@ -94,7 +94,7 @@ describe NotificationsController, :type => :controller do
it 'succeeds on mobile' do it 'succeeds on mobile' do
get :index, format: :mobile get :index, format: :mobile
expect(response).to be_success expect(response).to be_successful
end end
it 'paginates the notifications' do it 'paginates the notifications' do
@ -128,7 +128,7 @@ describe NotificationsController, :type => :controller do
it 'succeeds on mobile' do it 'succeeds on mobile' do
eve.share_with(alice.person, eve.aspects.first) eve.share_with(alice.person, eve.aspects.first)
get :index, format: :mobile get :index, format: :mobile
expect(response).to be_success expect(response).to be_successful
end end
end end
@ -157,12 +157,12 @@ describe NotificationsController, :type => :controller do
it "succeeds" do it "succeeds" do
get :index get :index
expect(response).to be_success expect(response).to be_successful
end end
it "succeeds on mobile" do it "succeeds on mobile" do
get :index, format: :mobile get :index, format: :mobile
expect(response).to be_success expect(response).to be_successful
end end
end end
end end

View file

@ -33,7 +33,7 @@ describe PeopleController, :type => :controller do
describe 'via json' do describe 'via json' do
it 'succeeds' do it 'succeeds' do
get :index, params: {q: "Korth"}, format: :json get :index, params: {q: "Korth"}, format: :json
expect(response).to be_success expect(response).to be_successful
end end
it 'responds with json' do it 'responds with json' do
@ -109,23 +109,23 @@ describe PeopleController, :type => :controller do
it "succeeds if there is exactly one match" do it "succeeds if there is exactly one match" do
get :index, params: {q: "Korth"} get :index, params: {q: "Korth"}
expect(assigns[:people].length).to eq(1) expect(assigns[:people].length).to eq(1)
expect(response).to be_success expect(response).to be_successful
end end
it "succeeds if there are no matches" do it "succeeds if there are no matches" do
get :index, params: {q: "Korthsauce"} get :index, params: {q: "Korthsauce"}
expect(assigns[:people].length).to eq(0) expect(assigns[:people].length).to eq(0)
expect(response).to be_success expect(response).to be_successful
end end
it 'succeeds if you search for the empty term' do it 'succeeds if you search for the empty term' do
get :index, params: {q: ""} get :index, params: {q: ""}
expect(response).to be_success expect(response).to be_successful
end end
it 'succeeds if you search for punctuation' do it 'succeeds if you search for punctuation' do
get :index, params: {q: "+"} get :index, params: {q: "+"}
expect(response).to be_success expect(response).to be_successful
end end
it "excludes people who have searchable off" do it "excludes people who have searchable off" do
@ -225,7 +225,7 @@ describe PeopleController, :type => :controller do
profile = user2.profile profile = user2.profile
profile.update_attribute(:first_name, "</script><script> alert('xss attack');</script>") profile.update_attribute(:first_name, "</script><script> alert('xss attack');</script>")
get :show, params: {id: user2.person.to_param} get :show, params: {id: user2.person.to_param}
expect(response).to be_success expect(response).to be_successful
expect(response.body).not_to include(profile.first_name) expect(response.body).not_to include(profile.first_name)
end end
@ -244,12 +244,12 @@ describe PeopleController, :type => :controller do
context "when the person is the current user" do context "when the person is the current user" do
it "succeeds" do it "succeeds" do
get :show, params: {id: @user.person.to_param} get :show, params: {id: @user.person.to_param}
expect(response).to be_success expect(response).to be_successful
end end
it 'succeeds on the mobile site' do it 'succeeds on the mobile site' do
get :show, params: {id: @user.person.to_param}, format: :mobile get :show, params: {id: @user.person.to_param}, format: :mobile
expect(response).to be_success expect(response).to be_successful
end end
it "assigns the right person" do it "assigns the right person" do
@ -271,7 +271,7 @@ describe PeopleController, :type => :controller do
it 'succeeds on the mobile site' do it 'succeeds on the mobile site' do
get :show, params: {id: @person.to_param}, format: :mobile get :show, params: {id: @person.to_param}, format: :mobile
expect(response).to be_success expect(response).to be_successful
end end
it 'forces to sign in if the person is remote' do it 'forces to sign in if the person is remote' do
@ -316,12 +316,12 @@ describe PeopleController, :type => :controller do
it "succeeds" do it "succeeds" do
get :show, params: {id: @person.to_param} get :show, params: {id: @person.to_param}
expect(response).to be_success expect(response).to be_successful
end end
it 'succeeds on the mobile site' do it 'succeeds on the mobile site' do
get :show, params: {id: @person.to_param}, format: :mobile get :show, params: {id: @person.to_param}, format: :mobile
expect(response).to be_success expect(response).to be_successful
end end
it 'marks a corresponding notifications as read' do it 'marks a corresponding notifications as read' do
@ -351,12 +351,12 @@ describe PeopleController, :type => :controller do
it "succeeds" do it "succeeds" do
get :show, params: {id: @person.to_param} get :show, params: {id: @person.to_param}
expect(response).to be_success expect(response).to be_successful
end end
it 'succeeds on the mobile site' do it 'succeeds on the mobile site' do
get :show, params: {id: @person.to_param}, format: :mobile get :show, params: {id: @person.to_param}, format: :mobile
expect(response).to be_success expect(response).to be_successful
end end
it "leaks no private profile info" do it "leaks no private profile info" do
@ -406,7 +406,7 @@ describe PeopleController, :type => :controller do
message = @user.post :status_message, :text => 'test more', :to => @aspect.id message = @user.post :status_message, :text => 'test more', :to => @aspect.id
@user.comment!(message, cmmt) @user.comment!(message, cmmt)
get :stream, params: {person_id: @user.person.to_param}, format: :json get :stream, params: {person_id: @user.person.to_param}, format: :json
expect(response).to be_success expect(response).to be_successful
expect(response.body).to include(cmmt) expect(response.body).to include(cmmt)
end end
end end

View file

@ -81,17 +81,17 @@ describe PhotosController, :type => :controller do
it "succeeds without any available pictures" do it "succeeds without any available pictures" do
get :index, params: {person_id: FactoryGirl.create(:person).guid} get :index, params: {person_id: FactoryGirl.create(:person).guid}
expect(response).to be_success expect(response).to be_successful
end end
it "succeeds on mobile devices without any available pictures" do it "succeeds on mobile devices without any available pictures" do
get :index, params: {person_id: FactoryGirl.create(:person).guid}, format: :mobile get :index, params: {person_id: FactoryGirl.create(:person).guid}, format: :mobile
expect(response).to be_success expect(response).to be_successful
end end
it "succeeds on mobile devices with available pictures" do it "succeeds on mobile devices with available pictures" do
get :index, params: {person_id: bob.person.guid}, format: :mobile get :index, params: {person_id: bob.person.guid}, format: :mobile
expect(response).to be_success expect(response).to be_successful
end end
it "displays the logged in user's pictures" do it "displays the logged in user's pictures" do
@ -145,7 +145,7 @@ describe PhotosController, :type => :controller do
it "succeeds on the mobile site" do it "succeeds on the mobile site" do
get :index, params: {person_id: @person.to_param}, format: :mobile get :index, params: {person_id: @person.to_param}, format: :mobile
expect(response).to be_success expect(response).to be_successful
end end
it "forces to sign in if the person is remote" do it "forces to sign in if the person is remote" do
@ -227,7 +227,7 @@ describe PhotosController, :type => :controller do
it 'should return 200 for existing stuff on mobile devices' do it 'should return 200 for existing stuff on mobile devices' do
get :show, params: {person_id: alice.person.guid, id: @alices_photo.id}, format: :mobile get :show, params: {person_id: alice.person.guid, id: @alices_photo.id}, format: :mobile
expect(response).to be_success expect(response).to be_successful
end end
it "doesn't leak private photos to the public" do it "doesn't leak private photos to the public" do

View file

@ -19,7 +19,7 @@ describe PostsController, type: :controller do
expect_any_instance_of(PostService).to receive(:mark_user_notifications).with(post.id) expect_any_instance_of(PostService).to receive(:mark_user_notifications).with(post.id)
get :show, params: {id: post.id} get :show, params: {id: post.id}
expect(response).to be_success expect(response).to be_successful
end end
it "succeeds after removing a mention when closing the mentioned user's account" do it "succeeds after removing a mention when closing the mentioned user's account" do
@ -32,7 +32,7 @@ describe PostsController, type: :controller do
user.close_account! user.close_account!
get :show, params: {id: msg.id} get :show, params: {id: msg.id}
expect(response).to be_success expect(response).to be_successful
end end
it "renders the application layout on mobile" do it "renders the application layout on mobile" do
@ -45,7 +45,7 @@ describe PostsController, type: :controller do
expect_any_instance_of(PostService).to receive(:mark_user_notifications).with(reshare_id) expect_any_instance_of(PostService).to receive(:mark_user_notifications).with(reshare_id)
get :show, params: {id: reshare_id}, format: :mobile get :show, params: {id: reshare_id}, format: :mobile
expect(response).to be_success expect(response).to be_successful
end end
end end

View file

@ -25,7 +25,7 @@ describe ProfilesController, :type => :controller do
describe '#edit' do describe '#edit' do
it 'succeeds' do it 'succeeds' do
get :edit get :edit
expect(response).to be_success expect(response).to be_successful
end end
it 'sets the profile to the current users profile' do it 'sets the profile to the current users profile' do

View file

@ -13,7 +13,7 @@ describe ResharesController, :type => :controller do
it 'requires authentication' do it 'requires authentication' do
post_request! post_request!
expect(response).not_to be_success expect(response).not_to be_successful
end end
context 'with an authenticated user' do context 'with an authenticated user' do
@ -23,7 +23,7 @@ describe ResharesController, :type => :controller do
end end
it 'succeeds' do it 'succeeds' do
expect(response).to be_success expect(response).to be_successful
post_request! post_request!
end end

View file

@ -17,7 +17,7 @@ describe ShareVisibilitiesController, :type => :controller do
it 'succeeds' do it 'succeeds' do
put :update, params: {id: 42, post_id: @status.id}, format: :js put :update, params: {id: 42, post_id: @status.id}, format: :js
expect(response).to be_success expect(response).to be_successful
end end
it 'it calls toggle_hidden_shareable' do it 'it calls toggle_hidden_shareable' do

View file

@ -17,7 +17,7 @@ describe StatusMessagesController, :type => :controller do
describe '#bookmarklet' do describe '#bookmarklet' do
it 'succeeds' do it 'succeeds' do
get :bookmarklet get :bookmarklet
expect(response).to be_success expect(response).to be_successful
end end
it 'contains a complete html document' do it 'contains a complete html document' do
@ -34,14 +34,14 @@ describe StatusMessagesController, :type => :controller do
title: "Surprised Kitty", title: "Surprised Kitty",
notes: "cute kitty" notes: "cute kitty"
} }
expect(response).to be_success expect(response).to be_successful
end end
end end
describe '#new' do describe '#new' do
it 'succeeds' do it 'succeeds' do
get :new, params: {person_id: bob.person.id} get :new, params: {person_id: bob.person.id}
expect(response).to be_success expect(response).to be_successful
end end
it 'should redirect on desktop version' do it 'should redirect on desktop version' do

View file

@ -15,19 +15,19 @@ describe StreamsController, :type => :controller do
describe "#public" do describe "#public" do
it "succeeds" do it "succeeds" do
get :public get :public
expect(response).to be_success expect(response).to be_successful
end end
end end
describe "#multi" do describe "#multi" do
it "succeeds" do it "succeeds" do
get :multi get :multi
expect(response).to be_success expect(response).to be_successful
end end
it "succeeds on mobile" do it "succeeds on mobile" do
get :multi, format: :mobile get :multi, format: :mobile
expect(response).to be_success expect(response).to be_successful
end end
context "getting started" do context "getting started" do
@ -54,7 +54,7 @@ describe StreamsController, :type => :controller do
describe "a GET to #{stream_path}" do describe "a GET to #{stream_path}" do
it "assigns a stream of the proper class" do it "assigns a stream of the proper class" do
get stream_path get stream_path
expect(response).to be_success expect(response).to be_successful
expect(assigns[:stream]).to be_a stream_class expect(assigns[:stream]).to be_a stream_class
end end
end end
@ -65,12 +65,12 @@ describe StreamsController, :type => :controller do
describe "#public" do describe "#public" do
it "succeeds" do it "succeeds" do
get :public get :public
expect(response).to be_success expect(response).to be_successful
end end
it "succeeds on mobile" do it "succeeds on mobile" do
get :public, format: :mobile get :public, format: :mobile
expect(response).to be_success expect(response).to be_successful
end end
end end

View file

@ -105,7 +105,7 @@ describe TagsController, :type => :controller do
it 'succeeds with mobile' do it 'succeeds with mobile' do
get :show, params: {name: "foo"}, format: :mobile get :show, params: {name: "foo"}, format: :mobile
expect(response).to be_success expect(response).to be_successful
end end
it "returns the post with the correct age" do it "returns the post with the correct age" do

View file

@ -4,12 +4,12 @@ describe TermsController, type: :controller do
describe "#index" do describe "#index" do
it "succeeds" do it "succeeds" do
get :index get :index
expect(response).to be_success expect(response).to be_successful
end end
it "succeeds on mobile" do it "succeeds on mobile" do
get :index, format: :mobile get :index, format: :mobile
expect(response).to be_success expect(response).to be_successful
end end
end end
end end

View file

@ -327,12 +327,12 @@ describe UsersController, :type => :controller do
describe 'getting_started' do describe 'getting_started' do
it 'does not fail miserably' do it 'does not fail miserably' do
get :getting_started get :getting_started
expect(response).to be_success expect(response).to be_successful
end end
it 'does not fail miserably on mobile' do it 'does not fail miserably on mobile' do
get :getting_started, format: :mobile get :getting_started, format: :mobile
expect(response).to be_success expect(response).to be_successful
end end
context "with inviter" do context "with inviter" do