Commit ee3960460e15a2a0adb82cca1adc0edd01736419
1 parent
83342d44
Exists in
master
and in
79 other branches
Add method to get a list of softwares for a person
Signed-off-by: Arthur Del Esposte <arthurmde@gmail.com> Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
Showing
2 changed files
with
25 additions
and
1 deletions
Show diff stats
lib/ext/person.rb
test/unit/mpog_person_test.rb
... | ... | @@ -79,4 +79,17 @@ class MpogSoftwarePluginPersonTest < ActiveSupport::TestCase |
79 | 79 | |
80 | 80 | assert_equal(100, @plugin.calc_percentage_registration(@person)) |
81 | 81 | end |
82 | -end | |
83 | 82 | \ No newline at end of file |
83 | + | |
84 | + should 'get a list of softwares of a person' do | |
85 | + software1 = create_software_info "noosfero" | |
86 | + software2 = create_software_info "colab" | |
87 | + community = create_community "simple_community" | |
88 | + | |
89 | + software1.community.add_member @person | |
90 | + software1.save! | |
91 | + community.add_member @person | |
92 | + community.save! | |
93 | + | |
94 | + assert_equal 1, @person.softwares.count | |
95 | + end | |
96 | +end | ... | ... |