From 92f71ed54d7739959d4feb8d787d322099aaf443 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Tue, 25 Oct 2011 13:30:09 -0300 Subject: [PATCH] [bsc-contract] Adding control panel button --- plugins/bsc/lib/bsc_plugin.rb | 1 + plugins/bsc/test/features/contract.feature | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 0 deletions(-) create mode 100644 plugins/bsc/test/features/contract.feature diff --git a/plugins/bsc/lib/bsc_plugin.rb b/plugins/bsc/lib/bsc_plugin.rb index a3075f2..d88e5be 100644 --- a/plugins/bsc/lib/bsc_plugin.rb +++ b/plugins/bsc/lib/bsc_plugin.rb @@ -22,6 +22,7 @@ class BscPlugin < Noosfero::Plugin buttons = [] buttons << {:title => _("Manage associated enterprises"), :icon => 'bsc-enterprises', :url => {:controller => 'bsc_plugin_myprofile', :action => 'manage_associated_enterprises'}} if bsc?(context.profile) buttons << {:title => _('Transfer ownership'), :icon => 'transfer-enterprise-ownership', :url => {:controller => 'bsc_plugin_myprofile', :action => 'transfer_ownership'}} if context.profile.enterprise? + buttons << {:title => _("Manage contracts"), :icon => '', :url => {:controller => 'bsc_plugin_myprofile', :action => 'manage_contracts'}} if bsc?(context.profile) buttons end diff --git a/plugins/bsc/test/features/contract.feature b/plugins/bsc/test/features/contract.feature new file mode 100644 index 0000000..c242a17 --- /dev/null +++ b/plugins/bsc/test/features/contract.feature @@ -0,0 +1,21 @@ +Feature: Bsc contract +As a Bsc admin +I would like to register a contract +In order to make negotiations + + Background: + Given "Bsc" plugin is enabled + And the folllowing "bsc" from "bsc_plugin" + | business_name | identifier | company_name | cnpj | + | Bsc Test | bsc-test | Bsc Test Ltda | 94.132.024/0001-48 | + And I am logged in as admin + + Scenario: be able see the manage contracts button only if the profile is a Bsc + Given the following community + | name | identifier | + | Sample Community | sample-community | + When I am on Sample Community's control panel + Then I should not see "Manage contracts" + But I am on Bsc Test's control panel + Then I should see "Manage contracts" + -- libgit2 0.21.2