Commit c719f4bd11916ee2075e17ebc3568b37c90c3621
Committed by
Rodrigo Souto
1 parent
d8427ca1
Exists in
master
and in
29 other branches
UserTest: avatar information could come in different url positions
Showing
1 changed file
with
9 additions
and
5 deletions
Show diff stats
test/unit/user_test.rb
... | ... | @@ -337,10 +337,8 @@ class UserTest < ActiveSupport::TestCase |
337 | 337 | Person.any_instance.stubs(:created_at).returns(DateTime.parse('16-08-2010')) |
338 | 338 | expected_hash = { |
339 | 339 | 'login' => 'x_and_y', 'is_admin' => true, 'since_month' => 8, |
340 | - 'chat_enabled' => false, 'since_year' => 2010, 'avatar' => | |
341 | - 'http://www.gravatar.com/avatar/a0517761d5125820c28d87860bc7c02e?only_path=false&d=&size=20', | |
342 | - 'email_domain' => nil, 'amount_of_friends' => 0, | |
343 | - 'friends_list' => {}, 'enterprises' => [], | |
340 | + 'chat_enabled' => false, 'since_year' => 2010, 'email_domain' => nil, | |
341 | + 'amount_of_friends' => 0, 'friends_list' => {}, 'enterprises' => [], | |
344 | 342 | } |
345 | 343 | |
346 | 344 | assert_equal expected_hash['login'], person.user.data_hash['login'] |
... | ... | @@ -348,7 +346,13 @@ class UserTest < ActiveSupport::TestCase |
348 | 346 | assert_equal expected_hash['since_month'], person.user.data_hash['since_month'] |
349 | 347 | assert_equal expected_hash['chat_enabled'], person.user.data_hash['chat_enabled'] |
350 | 348 | assert_equal expected_hash['since_year'], person.user.data_hash['since_year'] |
351 | - assert_equal expected_hash['avatar'], person.user.data_hash['avatar'] | |
349 | + | |
350 | + # Avatar stuff | |
351 | + assert_match 'http://www.gravatar.com/avatar/a0517761d5125820c28d87860bc7c02e', person.user.data_hash['avatar'] | |
352 | + assert_match 'only_path=false', person.user.data_hash['avatar'] | |
353 | + assert_match 'd=', person.user.data_hash['avatar'] | |
354 | + assert_match 'size=20', person.user.data_hash['avatar'] | |
355 | + | |
352 | 356 | assert_equal expected_hash['email_domain'], person.user.data_hash['email_domain'] |
353 | 357 | assert_equal expected_hash['amount_of_friends'], person.user.data_hash['amount_of_friends'] |
354 | 358 | assert_equal expected_hash['friends_list'], person.user.data_hash['friends_list'] | ... | ... |