Commit 42b08e8a authored by Jonne Haß's avatar Jonne Haß
Browse files

Update to Rails 4.1

parent acc86914
source 'https://rubygems.org'
gem 'rails', '4.0.9'
gem 'rails', '4.1.5'
# Legacy Rails features, remove me!
......
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.0.9)
actionpack (= 4.0.9)
actionmailer (4.1.5)
actionpack (= 4.1.5)
actionview (= 4.1.5)
mail (~> 2.5.4)
actionpack (4.0.9)
activesupport (= 4.0.9)
builder (~> 3.1.0)
erubis (~> 2.7.0)
actionpack (4.1.5)
actionview (= 4.1.5)
activesupport (= 4.1.5)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
actionpack-action_caching (1.1.1)
actionpack (>= 4.0.0, < 5.0)
actionpack-page_caching (1.0.2)
actionpack (>= 4.0.0, < 5)
activemodel (4.0.9)
activesupport (= 4.0.9)
builder (~> 3.1.0)
activerecord (4.0.9)
activemodel (= 4.0.9)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.9)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.3)
actionview (4.1.5)
activesupport (= 4.1.5)
builder (~> 3.1)
erubis (~> 2.7.0)
activemodel (4.1.5)
activesupport (= 4.1.5)
builder (~> 3.1)
activerecord (4.1.5)
activemodel (= 4.1.5)
activesupport (= 4.1.5)
arel (~> 5.0.0)
activerecord-import (0.5.0)
activerecord (>= 3.0)
activeresource (4.0.0)
activemodel (~> 4.0)
activesupport (~> 4.0)
rails-observers (~> 0.1.1)
activesupport (4.0.9)
activesupport (4.1.5)
i18n (~> 0.6, >= 0.6.9)
minitest (~> 4.2)
multi_json (~> 1.3)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
tzinfo (~> 1.1)
acts-as-taggable-on (3.2.6)
activerecord (>= 3, < 5)
acts_as_api (0.4.2)
......@@ -42,7 +44,7 @@ GEM
activesupport (>= 3.0.0)
rack (>= 1.1.0)
addressable (2.3.6)
arel (4.0.2)
arel (5.0.1.20140414130214)
asset_sync (1.0.0)
activemodel
fog (>= 1.8.0)
......@@ -58,7 +60,7 @@ GEM
bcrypt (3.1.7)
bootstrap-sass (2.3.2.2)
sass (~> 3.2)
builder (3.1.4)
builder (3.2.2)
capybara (2.4.1)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
......@@ -254,7 +256,7 @@ GEM
mini_magick (3.7.0)
subexec (~> 0.2.1)
mini_portile (0.5.3)
minitest (4.7.5)
minitest (5.4.0)
mobile-fu (1.3.1)
rack-mobile-detect
rails
......@@ -321,13 +323,15 @@ GEM
rack
rack-test (0.6.2)
rack (>= 1.0)
rails (4.0.9)
actionmailer (= 4.0.9)
actionpack (= 4.0.9)
activerecord (= 4.0.9)
activesupport (= 4.0.9)
rails (4.1.5)
actionmailer (= 4.1.5)
actionpack (= 4.1.5)
actionview (= 4.1.5)
activemodel (= 4.1.5)
activerecord (= 4.1.5)
activesupport (= 4.1.5)
bundler (>= 1.3.0, < 2.0)
railties (= 4.0.9)
railties (= 4.1.5)
sprockets-rails (~> 2.0)
rails-i18n (4.0.2)
i18n (~> 0.6)
......@@ -353,9 +357,9 @@ GEM
sass-rails (~> 4.0)
rails_autolink (1.1.5)
rails (> 3.1)
railties (4.0.9)
actionpack (= 4.0.9)
activesupport (= 4.0.9)
railties (4.1.5)
actionpack (= 4.1.5)
activesupport (= 4.1.5)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
raindrops (0.13.0)
......@@ -446,7 +450,8 @@ GEM
simple_oauth (~> 0.2)
typhoeus (0.6.8)
ethon (>= 0.7.0)
tzinfo (0.3.41)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (2.5.0)
execjs (>= 0.3.0)
json (>= 1.8.0)
......@@ -528,7 +533,7 @@ DEPENDENCIES
rack-protection (= 1.2)
rack-rewrite (= 1.5.0)
rack-ssl (= 1.4.1)
rails (= 4.0.9)
rails (= 4.1.5)
rails-i18n (= 4.0.2)
rails-timeago (= 2.4.0)
rails_admin (= 0.6.2)
......
......@@ -92,7 +92,7 @@ class PeopleController < ApplicationController
@block = current_user.blocks.where(:person_id => @person.id).first
@contact = current_user.contact_for(@person)
if @contact && !params[:only_posts]
@contacts_of_contact_count = @contact.contacts.count
@contacts_of_contact_count = @contact.contacts.count(:all)
@contacts_of_contact = @contact.contacts.limit(8)
else
@contact ||= Contact.new
......@@ -147,7 +147,7 @@ class PeopleController < ApplicationController
@contact = current_user.contact_for(@person)
@aspect = :profile
@contacts_of_contact = @contact.contacts.paginate(:page => params[:page], :per_page => (params[:limit] || 15))
@contacts_of_contact_count = @contact.contacts.count
@contacts_of_contact_count = @contact.contacts.count(:all)
@hashes = hashes_for_people @contacts_of_contact, @aspects
else
flash[:error] = I18n.t 'people.show.does_not_exist'
......
......@@ -26,7 +26,7 @@ class PhotosController < ApplicationController
if @contact
@contacts_of_contact = @contact.contacts
@contacts_of_contact_count = @contact.contacts.count
@contacts_of_contact_count = @contact.contacts.count(:all)
else
@contact = Contact.new
end
......
......@@ -53,6 +53,7 @@ class Profile < ActiveRecord::Base
end
def receive(user, person)
person.reload # make sure to have old profile referenced
Rails.logger.info("event=receive payload_type=profile sender=#{person} to=#{user}")
profiles_attr = self.attributes.merge('tag_string' => self.tag_string).slice('diaspora_handle', 'first_name', 'last_name', 'image_url', 'image_url_small', 'image_url_medium', 'birthday', 'gender', 'bio', 'location', 'searchable', 'nsfw', 'tag_string')
person.profile.update_attributes(profiles_attr)
......
......@@ -61,7 +61,7 @@
%h4
= t('.photos')
.item_count
= "#{@photos.count}"
= "#{@photos.count(:all)}"
- @photos.limit(8).each do |photo|
= image_tag(photo.url(:thumb_small))
%br
......
......@@ -16,18 +16,16 @@ class Postzord::Receiver::Private < Postzord::Receiver
end
def receive!
begin
if @sender && self.salmon.verified_for_key?(@sender.public_key)
parse_and_receive(salmon.parsed_data)
else
FEDERATION_LOGGER.info("event=receive status=abort recipient=#{@user.diaspora_handle} sender=#{@salmon.author_id} reason='not_verified for key'")
false
end
rescue => e
#this sucks
FEDERATION_LOGGER.error("Failure to receive #{@object.class} from sender:#{@sender.id} for user:#{@user.id}: #{e.message}\n#{@object.inspect}")
raise e
if @sender && self.salmon.verified_for_key?(@sender.public_key)
parse_and_receive(salmon.parsed_data)
else
FEDERATION_LOGGER.info("event=receive status=abort recipient=#{@user.diaspora_handle} sender=#{@salmon.author_id} reason='not_verified for key'")
false
end
rescue => e
#this sucks
FEDERATION_LOGGER.error("Failure to receive #{@object.class} from sender:#{@sender.id} for user:#{@user.id}: #{e.message}\n#{@object.inspect}")
raise e
end
def parse_and_receive(xml)
......@@ -101,7 +99,7 @@ class Postzord::Receiver::Private < Postzord::Receiver
def contact_required_unless_request
unless @object.is_a?(Request) || @user.contact_for(@sender)
FEDERATION_LOGGER.error("event=receive status=abort reason='sender not connected to recipient' recipient=#{@user_person.diaspora_handle} sender=#{@sender.diaspora_handle}")
return true
return true
end
end
......
......@@ -64,7 +64,7 @@ class Postzord::Receiver::Public < Postzord::Receiver
# @return [Array<Integer>] User ids
def recipient_user_ids
User.all_sharing_with_person(@author).select('users.id').map!{ |u| u.id }
User.all_sharing_with_person(@author).pluck('users.id')
end
def xml_author
......
......@@ -162,7 +162,7 @@ describe AspectsController do
@alices_aspect_1.contacts_visible = false
@alices_aspect_1.save
get :toggle_contact_visibility, :format => 'js', :aspect_id => @alices_aspect_1.id
xhr :get, :toggle_contact_visibility, :format => 'js', :aspect_id => @alices_aspect_1.id
@alices_aspect_1.reload.contacts_visible.should be_true
end
......@@ -170,7 +170,7 @@ describe AspectsController do
@alices_aspect_1.contacts_visible = true
@alices_aspect_1.save
get :toggle_contact_visibility, :format => 'js', :aspect_id => @alices_aspect_1.id
xhr :get, :toggle_contact_visibility, :format => 'js', :aspect_id => @alices_aspect_1.id
@alices_aspect_1.reload.contacts_visible.should be_false
end
end
......
......@@ -261,7 +261,7 @@ describe ConversationsController do
end
it 'succeeds with js' do
get :show, :id => @conversation.id, :format => :js
xhr :get, :show, :id => @conversation.id, :format => :js
response.should be_success
assigns[:conversation].should == @conversation
end
......
......@@ -118,7 +118,7 @@ describe PeopleController do
describe '#tag_index' do
it 'works for js' do
get :tag_index, :name => 'jellybeans', :format => :js
xhr :get, :tag_index, :name => 'jellybeans', :format => :js
response.should be_success
end
......@@ -126,7 +126,7 @@ describe PeopleController do
f = FactoryGirl.create(:person)
f.profile.tag_string = "#seeded"
f.profile.save
get :tag_index, :name => 'seeded', :format => :js
xhr :get, :tag_index, :name => 'seeded', :format => :js
assigns[:people].count.should == 1
end
end
......
......@@ -101,10 +101,10 @@ describe PhotosController do
response.headers['Content-Type'].should match 'application/json.*'
save_fixture(response.body, "photos_json")
end
it 'displays by date of creation' do
max_time = bob.photos.first.created_at - 1.day
get :index, person_id: bob.person.guid.to_s,
get :index, person_id: bob.person.guid.to_s,
max_time: max_time.to_i
assigns[:posts].should be_empty
......@@ -130,7 +130,7 @@ describe PhotosController do
end
it 'will let you delete your profile picture' do
get :make_profile_photo, :photo_id => @alices_photo.id, :format => :js
xhr :get, :make_profile_photo, :photo_id => @alices_photo.id, :format => :js
delete :destroy, :id => @alices_photo.id
Photo.find_by_id(@alices_photo.id).should be_nil
end
......@@ -182,7 +182,7 @@ describe PhotosController do
describe "#make_profile_photo" do
it 'should return a 201 on a js success' do
get :make_profile_photo, :photo_id => @alices_photo.id, :format => 'js'
xhr :get, :make_profile_photo, :photo_id => @alices_photo.id, :format => 'js'
response.code.should == "201"
end
......
......@@ -212,7 +212,7 @@ describe "attack vectors" do
expect {
receive_post(retraction, :from => alice, :by => bob)
}.to raise_error Diaspora::AuthorXMLAuthorMismatch
}.to_not change(bob.visible_shareables(Post), :count)
}.to_not change { bob.visible_shareables(Post).count(:all) }
end
......
......@@ -51,7 +51,7 @@ describe 'a user receives a post' do
bob.dispatch_post(sm, :to => @bobs_aspect)
end
alice.visible_shareables(Post).count.should == 1
alice.visible_shareables(Post).count(:all).should == 1
end
context 'with mentions, ' do
......@@ -259,7 +259,7 @@ describe 'a user receives a post' do
inlined_jobs do
@comment = bob.comment!(@post, 'tada')
@xml = @comment.to_diaspora_xml
expect {
receive_with_zord(alice, bob.person, @xml)
}.to_not raise_exception
......@@ -362,7 +362,6 @@ describe 'a user receives a post' do
#Build xml for profile
xml = new_profile.to_diaspora_xml
#Marshal profile
zord = Postzord::Receiver::Private.new(alice, :person => person)
zord.parse_and_receive(xml)
......
......@@ -22,7 +22,7 @@ describe Postzord::Receiver::Public do
bob.destroy
comment.destroy
expect{
receiver = Postzord::Receiver::Public.new(xml)
receiver = Postzord::Receiver::Public.new(xml)
receiver.perform!
}.to change(Comment, :count).by(1)
end
......@@ -61,7 +61,7 @@ describe Postzord::Receiver::Public do
@receiver.perform!
end
it 'enqueues a Workers::ReceiveLocalBatch' do
it 'enqueues a Workers::ReceiveLocalBatch' do
Workers::ReceiveLocalBatch.should_receive(:perform_async).with(anything, anything, anything)
@receiver.perform!
end
......@@ -84,13 +84,13 @@ describe Postzord::Receiver::Public do
describe '#recipient_user_ids' do
it 'calls User.all_sharing_with_person' do
User.should_receive(:all_sharing_with_person).and_return(double(:select => []))
User.should_receive(:all_sharing_with_person).and_return(double(:pluck => []))
receiver = Postzord::Receiver::Public.new(@xml)
receiver.perform!
end
end
describe '#receive_relayable' do
describe '#receive_relayable' do
before do
@comment = bob.build_comment(:text => 'yo', :post => FactoryGirl.create(:status_message))
@comment.save
......
......@@ -43,7 +43,7 @@ describe Post do
end
it 'should return the three visible posts' do
StatusMessage.owned_or_visible_by_user(@you).count.should == 3
StatusMessage.owned_or_visible_by_user(@you).count(:all).should == 3
end
end
......
......@@ -111,7 +111,7 @@ describe User::Querying do
describe "#visible_shareables" do
it 'never contains posts from people not in your aspects' do
FactoryGirl.create(:status_message, :public => true)
bob.visible_shareables(Post).count.should == 0
bob.visible_shareables(Post).count(:all).should == 0
end
context 'with two posts with the same timestamp' do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment