Commit 71ecb24fcd831edfb6e3df5367cb469d62aa527d

Authored by Antonio Terceiro
2 parents 53a98d7c e5e280f9

Merge branch 'master' of gitlab.com:noosfero/noosfero

plugins/organization_ratings/po/pt/organization_ratings.po
... ... @@ -7,8 +7,8 @@ msgid ""
7 7 msgstr ""
8 8 "Project-Id-Version: 1.3~rc2-1-ga15645d\n"
9 9 "POT-Creation-Date: 2015-10-30 16:35-0300\n"
10   -"PO-Revision-Date: 2016-01-21 15:50+0000\n"
11   -"Last-Translator: Dylan Guedes <djmgguedes@gmail.com>\n"
  10 +"PO-Revision-Date: 2016-02-18 14:44+0000\n"
  11 +"Last-Translator: Eduardo Vital <vitaldu@gmail.com>\n"
12 12 "Language-Team: Portuguese <https://hosted.weblate.org/projects/noosfero"
13 13 "/plugin-organization-ratings/pt/>\n"
14 14 "Language: pt\n"
... ... @@ -261,7 +261,7 @@ msgstr &quot;para esta %s.&quot;
261 261  
262 262 #: plugins/organization_ratings/views/organization_ratings_plugin_profile/_new_rating_fields.html.erb:70
263 263 msgid "Hi, %s! The administrators set the minimum time of"
264   -msgstr "Olá, %s! Os administradores configuraram o tempo mínimo de "
  264 +msgstr "Olá, %s! Os administradores configuraram o tempo mínimo de"
265 265  
266 266 #: plugins/organization_ratings/views/organization_ratings_plugin_profile/_new_rating_fields.html.erb:71
267 267 msgid "%d hour(s)"
... ...
plugins/site_tour/po/pt/site_tour.po
... ... @@ -2,14 +2,16 @@ msgid &quot;&quot;
2 2 msgstr ""
3 3 "Project-Id-Version: 1.3~rc2-1-ga15645d\n"
4 4 "POT-Creation-Date: 2015-10-30 16:35-0300\n"
5   -"PO-Revision-Date: 2015-02-03 17:27-0300\n"
6   -"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
7   -"Language-Team: LANGUAGE <LL@li.org>\n"
8   -"Language: \n"
  5 +"PO-Revision-Date: 2016-02-18 14:44+0000\n"
  6 +"Last-Translator: Eduardo Vital <vitaldu@gmail.com>\n"
  7 +"Language-Team: Portuguese <https://hosted.weblate.org/projects/noosfero"
  8 +"/plugin-site-tour/pt/>\n"
  9 +"Language: pt\n"
9 10 "MIME-Version: 1.0\n"
10 11 "Content-Type: text/plain; charset=UTF-8\n"
11 12 "Content-Transfer-Encoding: 8bit\n"
12   -"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
  13 +"Plural-Forms: nplurals=2; plural=n != 1;\n"
  14 +"X-Generator: Weblate 2.5-dev\n"
13 15  
14 16 #: plugins/site_tour/lib/site_tour_plugin/tour_block.rb:3
15 17 msgid "Click to start tour!"
... ... @@ -88,7 +90,7 @@ msgstr &quot;Próximo&quot;
88 90  
89 91 #: plugins/site_tour/views/tour_actions.html.erb:17
90 92 msgid "Back"
91   -msgstr "Anterior"
  93 +msgstr "Voltar"
92 94  
93 95 #: plugins/site_tour/views/tour_actions.html.erb:18
94 96 msgid "Skip"
... ...
po/pt/noosfero.po
... ... @@ -13,8 +13,8 @@ msgid &quot;&quot;
13 13 msgstr ""
14 14 "Project-Id-Version: 1.3~rc2-8-g01ea9f7\n"
15 15 "POT-Creation-Date: 2015-11-04 12:36-0300\n"
16   -"PO-Revision-Date: 2016-01-21 16:56+0000\n"
17   -"Last-Translator: Dylan Guedes <djmgguedes@gmail.com>\n"
  16 +"PO-Revision-Date: 2016-02-18 14:44+0000\n"
  17 +"Last-Translator: Eduardo Vital <vitaldu@gmail.com>\n"
18 18 "Language-Team: Portuguese "
19 19 "<https://hosted.weblate.org/projects/noosfero/noosfero/pt/>\n"
20 20 "Language: pt\n"
... ... @@ -9258,7 +9258,7 @@ msgstr &quot;Fãs de %s&quot;
9258 9258  
9259 9259 #: app/views/profile/_create_article.html.erb:12
9260 9260 msgid "See more"
9261   -msgstr "Ver mais"
  9261 +msgstr "Veja mais"
9262 9262  
9263 9263 #: app/views/profile/index.html.erb:32
9264 9264 msgid "Network"
... ...
test/unit/action_tracker_notification_test.rb
... ... @@ -89,7 +89,8 @@ class ActionTrackerNotificationTest &lt; ActiveSupport::TestCase
89 89 end
90 90  
91 91 should "have comments through article action_tracker" do
92   - person = create_user.person
  92 + user = User.current = create_user
  93 + person = user.person
93 94 article = create(TextileArticle, :profile_id => person.id)
94 95 process_delayed_job_queue
95 96 notification = ActionTrackerNotification.last
... ...
test/unit/article_test.rb
... ... @@ -7,7 +7,8 @@ class ArticleTest &lt; ActiveSupport::TestCase
7 7  
8 8 def setup
9 9 ActiveSupport::TestCase::setup
10   - @profile = create_user('testing').person
  10 + user = User.current = create_user 'testing'
  11 + @profile = user.person
11 12 end
12 13 attr_reader :profile
13 14  
... ... @@ -468,14 +469,12 @@ class ArticleTest &lt; ActiveSupport::TestCase
468 469 end
469 470  
470 471 should 'say that logged off user cannot see private article' do
471   - profile = fast_create(Profile, :name => 'test profile', :identifier => 'test_profile')
472 472 article = fast_create(Article, :name => 'test article', :profile_id => profile.id, :published => false)
473 473  
474 474 refute article.display_to?(nil)
475 475 end
476 476  
477 477 should 'say that not member of profile cannot see private article' do
478   - profile = fast_create(Profile, :name => 'test profile', :identifier => 'test_profile')
479 478 article = fast_create(Article, :name => 'test article', :profile_id => profile.id, :published => false)
480 479 person = create_user('test_user').person
481 480  
... ... @@ -483,7 +482,6 @@ class ArticleTest &lt; ActiveSupport::TestCase
483 482 end
484 483  
485 484 should 'say that member user can not see private article' do
486   - profile = fast_create(Profile, :name => 'test profile', :identifier => 'test_profile')
487 485 article = fast_create(Article, :name => 'test article', :profile_id => profile.id, :published => false, :show_to_followers => false)
488 486 person = create_user('test_user').person
489 487 profile.affiliate(person, Profile::Roles.member(profile.environment.id))
... ... @@ -492,25 +490,23 @@ class ArticleTest &lt; ActiveSupport::TestCase
492 490 end
493 491  
494 492 should 'say that profile admin can see private article' do
495   - profile = fast_create(Profile, :name => 'test profile', :identifier => 'test_profile')
  493 + org = fast_create(Profile, :name => 'test profile', :identifier => 'test_profile')
496 494 article = fast_create(Article, :name => 'test article', :profile_id => profile.id, :published => false)
497   - person = create_user('test_user').person
498   - profile.affiliate(person, Profile::Roles.admin(profile.environment.id))
  495 + org.affiliate(profile, Profile::Roles.admin(org.environment.id))
499 496  
500   - assert article.display_to?(person)
  497 + assert article.display_to?(profile)
501 498 end
502 499  
503 500 should 'say that profile moderator can see private article' do
504   - profile = fast_create(Profile, :name => 'test profile', :identifier => 'test_profile')
505   - article = fast_create(Article, :name => 'test article', :profile_id => profile.id, :published => false)
506   - person = create_user('test_user').person
507   - profile.affiliate(person, Profile::Roles.moderator(profile.environment.id))
  501 + org = fast_create(Profile, :name => 'test profile', :identifier => 'test_profile')
  502 + article = fast_create(Article, :name => 'test article', :profile_id => org.id, :published => false)
  503 + org.affiliate(profile, Profile::Roles.moderator(org.environment.id))
508 504  
509   - assert article.display_to?(person)
  505 + assert article.display_to?(profile)
510 506 end
511 507  
512 508 should 'show article to non member if article public but profile private' do
513   - profile = fast_create(Profile, :name => 'test profile', :identifier => 'test_profile', :public_profile => false)
  509 + profile.update public_profile: false
514 510 article = fast_create(Article, :name => 'test article', :profile_id => profile.id, :published => true)
515 511 person1 = create_user('test_user1').person
516 512 profile.affiliate(person1, Profile::Roles.member(profile.environment.id))
... ... @@ -522,7 +518,6 @@ class ArticleTest &lt; ActiveSupport::TestCase
522 518 end
523 519  
524 520 should 'make new article private if created inside a private folder' do
525   - profile = fast_create(Profile, :name => 'test profile', :identifier => 'test_profile')
526 521 folder = fast_create(Folder, :name => 'my_intranet', :profile_id => profile.id, :published => false)
527 522 article = fast_create(Article, :name => 'my private article', :profile_id => profile.id, :parent_id => folder.id)
528 523  
... ... @@ -530,7 +525,6 @@ class ArticleTest &lt; ActiveSupport::TestCase
530 525 end
531 526  
532 527 should 'save as private' do
533   - profile = fast_create(Profile, :name => 'test profile', :identifier => 'test_profile')
534 528 folder = fast_create(Folder, :name => 'my_intranet', :profile_id => profile.id, :published => false)
535 529 article = fast_create(Article, :name => 'my private article')
536 530 article.profile = profile
... ... @@ -1012,13 +1006,13 @@ class ArticleTest &lt; ActiveSupport::TestCase
1012 1006  
1013 1007 should 'not notify activity by default on create' do
1014 1008 ActionTracker::Record.delete_all
1015   - create Article, :name => 'test', :profile_id => fast_create(Profile).id, :published => true
  1009 + create Article, :name => 'test', :profile_id => profile.id, :published => true
1016 1010 assert_equal 0, ActionTracker::Record.count
1017 1011 end
1018 1012  
1019 1013 should 'not notify activity by default on update' do
1020 1014 ActionTracker::Record.delete_all
1021   - a = create Article, :name => 'bar', :profile_id => fast_create(Profile).id, :published => true
  1015 + a = create Article, :name => 'bar', :profile_id => profile.id, :published => true
1022 1016 a.name = 'foo'
1023 1017 a.save!
1024 1018 assert_equal 0, ActionTracker::Record.count
... ... @@ -1026,13 +1020,13 @@ class ArticleTest &lt; ActiveSupport::TestCase
1026 1020  
1027 1021 should 'not notify activity by default on destroy' do
1028 1022 ActionTracker::Record.delete_all
1029   - a = create Article, :name => 'bar', :profile_id => fast_create(Profile).id, :published => true
  1023 + a = create Article, :name => 'bar', :profile_id => profile.id, :published => true
1030 1024 a.destroy
1031 1025 assert_equal 0, ActionTracker::Record.count
1032 1026 end
1033 1027  
1034 1028 should 'create activity' do
1035   - a = create TextileArticle, :name => 'bar', :profile_id => fast_create(Profile).id, :published => true
  1029 + a = create TextileArticle, :name => 'bar', :profile_id => profile.id, :published => true
1036 1030 a.activity.destroy
1037 1031 assert_nil a.activity
1038 1032  
... ... @@ -1212,10 +1206,9 @@ class ArticleTest &lt; ActiveSupport::TestCase
1212 1206 end
1213 1207  
1214 1208 should 'get article galleries' do
1215   - p = fast_create(Profile)
1216   - a = fast_create(Article, :profile_id => p.id)
1217   - g = fast_create(Gallery, :profile_id => p.id)
1218   - assert_equal [g], p.articles.galleries
  1209 + a = fast_create(Article, :profile_id => profile.id)
  1210 + g = fast_create(Gallery, :profile_id => profile.id)
  1211 + assert_equal [g], profile.articles.galleries
1219 1212 end
1220 1213  
1221 1214 should 'has many translations' do
... ... @@ -1236,7 +1229,7 @@ class ArticleTest &lt; ActiveSupport::TestCase
1236 1229 end
1237 1230  
1238 1231 should 'validate inclusion of language' do
1239   - a = build(Article, :profile_id => fast_create(Profile).id)
  1232 + a = build(Article, :profile_id => profile.id)
1240 1233 a.language = '12'
1241 1234 a.valid?
1242 1235 assert a.errors[:language.to_s].present?
... ... @@ -1268,7 +1261,7 @@ class ArticleTest &lt; ActiveSupport::TestCase
1268 1261 end
1269 1262  
1270 1263 should 'list possible translations' do
1271   - native_article = fast_create(Article, :language => 'pt', :profile_id => fast_create(Profile).id )
  1264 + native_article = fast_create(Article, :language => 'pt', :profile_id => profile.id )
1272 1265 article_translation = fast_create(Article, :language => 'en', :translation_of_id => native_article.id)
1273 1266 possible_translations = native_article.possible_translations
1274 1267 refute possible_translations.include?('en')
... ... @@ -1278,7 +1271,7 @@ class ArticleTest &lt; ActiveSupport::TestCase
1278 1271 should 'verify if translation is already in use' do
1279 1272 native_article = fast_create(Article, :language => 'pt')
1280 1273 article_translation = fast_create(Article, :language => 'en', :translation_of_id => native_article.id)
1281   - a = build(Article, :profile => fast_create(Profile))
  1274 + a = build(Article, :profile => profile)
1282 1275 a.language = 'en'
1283 1276 a.translation_of = native_article
1284 1277 a.valid?
... ... @@ -1290,7 +1283,7 @@ class ArticleTest &lt; ActiveSupport::TestCase
1290 1283  
1291 1284 should 'verify if native translation is already in use' do
1292 1285 native_article = fast_create(Article, :language => 'pt')
1293   - a = build(Article, :profile => fast_create(Profile))
  1286 + a = build(Article, :profile => profile)
1294 1287 a.language = 'pt'
1295 1288 a.translation_of = native_article
1296 1289 a.valid?
... ... @@ -1302,7 +1295,7 @@ class ArticleTest &lt; ActiveSupport::TestCase
1302 1295  
1303 1296 should 'translation have a language' do
1304 1297 native_article = fast_create(Article, :language => 'pt')
1305   - a = build(Article, :profile_id => fast_create(Profile).id)
  1298 + a = build(Article, :profile_id => profile.id)
1306 1299 a.translation_of = native_article
1307 1300 a.valid?
1308 1301 assert a.errors[:language.to_s].present?
... ... @@ -1312,8 +1305,8 @@ class ArticleTest &lt; ActiveSupport::TestCase
1312 1305 end
1313 1306  
1314 1307 should 'native translation have a language' do
1315   - native_article = fast_create(Article, :profile_id => fast_create(Profile).id )
1316   - a = build(Article, :profile_id => fast_create(Profile).id)
  1308 + native_article = fast_create(Article, :profile_id => profile.id )
  1309 + a = build(Article, :profile_id => profile.id)
1317 1310 a.language = 'en'
1318 1311 a.translation_of = native_article
1319 1312 a.valid?
... ... @@ -1378,22 +1371,22 @@ class ArticleTest &lt; ActiveSupport::TestCase
1378 1371 end
1379 1372  
1380 1373 should 'get only non translated articles' do
1381   - p = fast_create(Profile)
1382   - native = fast_create(Article, :language => 'pt', :profile_id => p.id)
1383   - translation = fast_create(Article, :language => 'en', :translation_of_id => native.id, :profile_id => p.id)
1384   - assert_equal [native], p.articles.native_translations
  1374 + profile.articles.delete_all
  1375 + native = fast_create(Article, :language => 'pt', :profile_id => profile.id)
  1376 + translation = fast_create(Article, :language => 'en', :translation_of_id => native.id, :profile_id => profile.id)
  1377 + assert_equal [native], profile.articles.native_translations
1385 1378 end
1386 1379  
1387 1380 should 'not list own language as a possible translation if language has changed' do
1388   - a = build(Article, :language => 'pt', :profile_id => fast_create(Profile).id)
  1381 + a = build(Article, :language => 'pt', :profile_id => profile.id)
1389 1382 refute a.possible_translations.include?('pt')
1390   - a = fast_create(Article, :language => 'pt', :profile_id => fast_create(Profile).id )
  1383 + a = fast_create(Article, :language => 'pt', :profile_id => profile.id )
1391 1384 a.language = 'en'
1392 1385 refute a.possible_translations.include?('en')
1393 1386 end
1394 1387  
1395 1388 should 'list own language as a possible translation if language has not changed' do
1396   - a = fast_create(Article, :language => 'pt', :profile_id => fast_create(Profile).id)
  1389 + a = fast_create(Article, :language => 'pt', :profile_id => profile.id)
1397 1390 assert a.possible_translations.include?('pt')
1398 1391 end
1399 1392  
... ... @@ -1435,7 +1428,6 @@ class ArticleTest &lt; ActiveSupport::TestCase
1435 1428 should 'return only folders' do
1436 1429 not_folders = [RssFeed, TinyMceArticle, Event, TextileArticle]
1437 1430 folders = [Folder, Blog, Gallery, Forum]
1438   - profile = fast_create(Profile)
1439 1431  
1440 1432 not_folders.each do |klass|
1441 1433 item = fast_create(klass)
... ... @@ -1451,7 +1443,6 @@ class ArticleTest &lt; ActiveSupport::TestCase
1451 1443 should 'return no folders' do
1452 1444 not_folders = [RssFeed, TinyMceArticle, Event, TextileArticle]
1453 1445 folders = [Folder, Blog, Gallery, Forum]
1454   - profile = fast_create(Profile)
1455 1446  
1456 1447 not_folders.each do |klass|
1457 1448 item = fast_create(klass)
... ... @@ -1611,18 +1602,16 @@ class ArticleTest &lt; ActiveSupport::TestCase
1611 1602 end
1612 1603  
1613 1604 should 'delegate region info to profile' do
1614   - profile = fast_create(Profile)
1615   - Profile.any_instance.expects(:region)
1616   - Profile.any_instance.expects(:region_id)
  1605 + Person.any_instance.expects(:region)
  1606 + Person.any_instance.expects(:region_id)
1617 1607 article = fast_create(Article, :profile_id => profile.id)
1618 1608 article.region
1619 1609 article.region_id
1620 1610 end
1621 1611  
1622 1612 should 'delegate environment info to profile' do
1623   - profile = fast_create(Profile)
1624   - Profile.any_instance.expects(:environment)
1625   - Profile.any_instance.expects(:environment_id)
  1613 + Person.any_instance.expects(:environment)
  1614 + Person.any_instance.expects(:environment_id)
1626 1615 article = fast_create(Article, :profile_id => profile.id)
1627 1616 article.environment
1628 1617 article.environment_id
... ...