Commit e092f47212afb8ae46a7b65a7a66f3e2e87ef6ca
Committed by
Luciano Prestes
1 parent
77665009
Exists in
master
and in
5 other branches
Software moderation unit tests.
Signed-off-by: David Carlos <ddavidcarlos1392@gmail.com> Signed-off-by: Lucinano Prestes <lucianopcbr@gmail.com>
Showing
1 changed file
with
22 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,22 @@ |
| 1 | +require File.dirname(__FILE__) + '/../../../../test/test_helper' | |
| 2 | + | |
| 3 | +class SoftwareRegistrationTest < ActiveSupport::TestCase | |
| 4 | + | |
| 5 | + def setup | |
| 6 | + @community = Community.new(:name => "test") | |
| 7 | + @community.save | |
| 8 | + @atributes = {} | |
| 9 | + #@license_info = LicenseInfo::new | |
| 10 | + @atributes = {:name => @community.name} | |
| 11 | + @environment = Environment.default | |
| 12 | + @environment.enable_plugin(MpogSoftwarePlugin) | |
| 13 | + end | |
| 14 | + | |
| 15 | + should 'include software registration task if is admin' do | |
| 16 | + person = create_user('molly').person | |
| 17 | + @environment.add_admin(person) | |
| 18 | + task = CreateSoftware.create!(@atributes.merge(:requestor => person,:environment => @environment)) | |
| 19 | + Person.any_instance.stubs(:is_admin?).returns(true) | |
| 20 | + assert_equal [task], Task.to(person).pending | |
| 21 | + end | |
| 22 | +end | ... | ... |