Skip to content
Extraits de code Groupes Projets
Valider d7bbb66d rédigé par Raphael's avatar Raphael
Parcourir les fichiers

Run whitespace:cleanup

parent 0831812e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -11,7 +11,7 @@
# USAGE: ./script/ubuntu-setup.bash
# Do NOT run this script as root.
# Set extented globbing
# Set extented globbing
shopt -s extglob
# fail on error
......@@ -23,29 +23,29 @@ We need to do some actions as an ordinary user. We use sudo where necessary." &&
# Check if the user has sudo privileges.
sudo -v >/dev/null 2>&1 || { echo $(whoami) has no sudo privileges ; exit 1; }
# Check if universal repository is enabled
# Check if universal repository is enabled
grep -i universe /etc/apt/sources.list > /dev/null || \
{ echo "Please enable universe repository" ; exit 1 ; }
# Make sure that we only install the latest version of packages
sudo apt-get update
# Check if wget is installed
# Check if wget is installed
test wget || { echo "Installing wget.." && sudo apt-get install wget \
&& echo "Installed wget.." ; }
# Install build tools
# Install build tools
echo "Installing build tools.."
sudo apt-get -y --no-install-recommends install \
build-essential libxslt1.1 libxslt1-dev libxml2
echo "..Done installing build tools"
# Install Ruby 1.8.7
echo "Installing ruby-full Ruby 1.8.7.."
# Install Ruby 1.8.7
echo "Installing ruby-full Ruby 1.8.7.."
sudo apt-get -y --no-install-recommends install ruby-full
echo "..Done installing Ruby"
# Install Rake
# Install Rake
echo "Installing rake.."
sudo apt-get -y --no-install-recommends install rake
echo "..Done installing rake"
......@@ -121,8 +121,8 @@ echo "Fetching and installing ruby gems.."
echo "."
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
echo "."
fi
)
fi
)
echo "Done installing the gems.."
# Install bundler
......
......@@ -24,7 +24,7 @@ describe PublicsController do
user.reload
user.visible_post_ids.include?(message.id).should be false
xml = user2.salmon(message).xml_for(user.person)
post :receive, :id => user.person.id, :xml => xml
......
......@@ -20,11 +20,11 @@ describe UsersController do
it "doesn't overwrite the profile photo when an empty string is passed in" do
image_url = @user.person.profile.image_url
put("update", :id => @user.id, "user"=> {"profile"=>
put("update", :id => @user.id, "user"=> {"profile"=>
{"image_url" => "",
"last_name" => @user.person.profile.last_name,
"first_name" => @user.person.profile.first_name}})
@user.person.profile.image_url.should == image_url
end
end
......@@ -33,33 +33,33 @@ describe UsersController do
it 'should change a users password ' do
old_password = @user.encrypted_password
put("update", :id => @user.id, "user"=> {"password" => "foobaz", 'password_confirmation' => "foobaz","profile"=>
put("update", :id => @user.id, "user"=> {"password" => "foobaz", 'password_confirmation' => "foobaz","profile"=>
{"image_url" => "",
"last_name" => @user.person.profile.last_name,
"first_name" => @user.person.profile.first_name}})
"first_name" => @user.person.profile.first_name}})
@user.reload
@user.encrypted_password.should_not == old_password
end
it 'should not change a password if they do not match' do
old_password = @user.encrypted_password
put("update", :id => @user.id, "user"=> {"password" => "foobarz", 'password_confirmation' => "not_the_same","profile"=>
it 'should not change a password if they do not match' do
old_password = @user.encrypted_password
put("update", :id => @user.id, "user"=> {"password" => "foobarz", 'password_confirmation' => "not_the_same","profile"=>
{"image_url" => "",
"last_name" => @user.person.profile.last_name,
"first_name" => @user.person.profile.first_name}})
"first_name" => @user.person.profile.first_name}})
@user.reload
@user.encrypted_password.should == old_password
end
it 'should not update if the password fields are left blank' do
old_password = @user.encrypted_password
put("update", :id => @user.id, "user"=> {"password" => "", 'password_confirmation' => "","profile"=>
it 'should not update if the password fields are left blank' do
old_password = @user.encrypted_password
put("update", :id => @user.id, "user"=> {"password" => "", 'password_confirmation' => "","profile"=>
{"image_url" => "",
"last_name" => @user.person.profile.last_name,
"first_name" => @user.person.profile.first_name}})
"first_name" => @user.person.profile.first_name}})
@user.reload
@user.encrypted_password.should == old_password
end
......
......@@ -8,7 +8,7 @@ describe Diaspora::Parser do
before do
@user = Factory.create(:user, :email => "bob@aol.com")
@aspect = @user.aspect(:name => 'spies')
@user3 = Factory.create :user
@person = @user3.person
@user2 = Factory.create(:user)
......
......@@ -11,17 +11,17 @@ describe Salmon do
let(:post){ user.post :status_message, :message => "hi", :to => user.aspect(:name => "sdg").id }
let!(:created_salmon) {Salmon::SalmonSlap.create(user, post.to_diaspora_xml)}
describe '#create' do
it 'has data in the magic envelope' do
created_salmon.magic_sig.data.should_not be nil
end
it 'has no parsed_data' do
created_salmon.parsed_data.should be nil
end
it 'sets aes and iv key' do
created_salmon.aes_key.should_not be nil
created_salmon.iv.should_not be nil
......@@ -33,7 +33,7 @@ describe Salmon do
user.aes_decrypt(decoded_string, key_hash).should == post.to_diaspora_xml
end
end
describe '#xml_for' do
let(:xml) {created_salmon.xml_for user2.person}
......@@ -50,7 +50,7 @@ describe Salmon do
context 'marshaling' do
let(:xml) {created_salmon.xml_for user2.person}
let(:parsed_salmon) { Salmon::SalmonSlap.parse(xml, user2)}
let(:parsed_salmon) { Salmon::SalmonSlap.parse(xml, user2)}
it 'should parse out the aes key' do
parsed_salmon.aes_key.should == created_salmon.aes_key
......
......@@ -7,9 +7,9 @@
require File.dirname(__FILE__) + '/../spec_helper'
describe FbStatus do
let(:fb_status) { Factory.create :fb_status }
it 'is valid' do
fb_status.should be_valid
end
......@@ -22,7 +22,7 @@ describe FbStatus do
it 'has graph_id' do
status_from_json.graph_id.should == json_object['id']
end
it 'has author_id' do
status_from_json.author_id.should == json_object['from']['id']
end
......@@ -39,5 +39,5 @@ describe FbStatus do
status_from_json.updated_time.should == Time.parse(json_object['updated_time'])
end
end
end
......@@ -9,7 +9,7 @@ describe 'user encryption' do
unstub_mocha_stubs
@user = Factory.create(:user)
@aspect = @user.aspect(:name => 'dudes')
@user2 = Factory.create(:user)
@aspect2 = @user2.aspect(:name => 'dudes')
end
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter