Skip to content
Extraits de code Groupes Projets
Valider 8352a7cf rédigé par ilya's avatar ilya
Parcourir les fichiers

Merge branch 'master' of github.com:diaspora/diaspora

Conflicts:
	config/routes.rb
parents 7ecc94d7 7e8bf40a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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