diff --git a/test/unit/software_registration_test.rb b/test/unit/software_registration_test.rb new file mode 100644 index 0000000..f415e8a --- /dev/null +++ b/test/unit/software_registration_test.rb @@ -0,0 +1,22 @@ +require File.dirname(__FILE__) + '/../../../../test/test_helper' + +class SoftwareRegistrationTest < ActiveSupport::TestCase + + def setup + @community = Community.new(:name => "test") + @community.save + @atributes = {} + #@license_info = LicenseInfo::new + @atributes = {:name => @community.name} + @environment = Environment.default + @environment.enable_plugin(MpogSoftwarePlugin) + end + + should 'include software registration task if is admin' do + person = create_user('molly').person + @environment.add_admin(person) + task = CreateSoftware.create!(@atributes.merge(:requestor => person,:environment => @environment)) + Person.any_instance.stubs(:is_admin?).returns(true) + assert_equal [task], Task.to(person).pending + end +end -- libgit2 0.21.2