diff --git a/src/noosfero-spb/gov_user/lib/institution.rb b/src/noosfero-spb/gov_user/lib/institution.rb index ba59672..c8fe96f 100644 --- a/src/noosfero-spb/gov_user/lib/institution.rb +++ b/src/noosfero-spb/gov_user/lib/institution.rb @@ -8,7 +8,7 @@ class Institution < ActiveRecord::Base :display => %w[compact] } - CNPJ_FORMAT = /^\d{2}\.\d{3}\.\d{3}\/\d{4}\-\d{2}$/ + CNPJ_FORMAT = /\A\d{2}\.\d{3}\.\d{3}\/\d{4}\-\d{2}\z/ VALID_STATES = { "AC"=>"Acre", "AL"=>"Alagoas", "AM"=>"Amazonas", "AP"=>"Amapá", "BA"=>"Bahia", "CE"=>"Ceará", "DF"=>"Distrito Federal", "ES"=>"Espírito Santo", "GO"=>"Goiás", "MA"=>"Maranhão", "MT"=>"Mato Grosso", diff --git a/src/noosfero-spb/gov_user/test/helpers/plugin_test_helper.rb b/src/noosfero-spb/gov_user/test/helpers/plugin_test_helper.rb index d4816d4..5bc30e3 100644 --- a/src/noosfero-spb/gov_user/test/helpers/plugin_test_helper.rb +++ b/src/noosfero-spb/gov_user/test/helpers/plugin_test_helper.rb @@ -9,17 +9,17 @@ module PluginTestHelper password, password_confirmation ) - person = Person::new - - user.person = person - person.user = user + person = Person.new person.name = name person.identifier = name.to_slug person.state = state person.city = city + user.person = person user.save + + person.user_id = user.id person.save person diff --git a/src/noosfero-spb/gov_user/test/unit/institutions_block_test.rb b/src/noosfero-spb/gov_user/test/unit/institutions_block_test.rb index e0af039..2272b75 100644 --- a/src/noosfero-spb/gov_user/test/unit/institutions_block_test.rb +++ b/src/noosfero-spb/gov_user/test/unit/institutions_block_test.rb @@ -23,6 +23,7 @@ class InstitutionsBlockTest < ActiveSupport::TestCase end should 'list institutions' do + Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([GovUserPlugin.new]) user = create_person("Jose_Augusto", "jose_augusto@email.com", "aaaaaaa", @@ -40,7 +41,6 @@ class InstitutionsBlockTest < ActiveSupport::TestCase "00.111.222/3333-44" ) institution.community.add_member(user) - block = InstitutionsBlock.new block.expects(:owner).at_least_once.returns(user) diff --git a/src/noosfero-spb/software_communities/features/software_block.feature b/src/noosfero-spb/software_communities/features/software_block.feature index da10d97..518d5fe 100644 --- a/src/noosfero-spb/software_communities/features/software_block.feature +++ b/src/noosfero-spb/software_communities/features/software_block.feature @@ -10,36 +10,26 @@ Feature: edit adherent fields And I check "SoftwareCommunitiesPlugin" And I press "Save changes" And the following softwares - | name | public_software | finality | - | Public Software | true | some finality | - | Generic Software | false | some finality | - - Scenario: Add software block - Given I follow "Control panel" - And I follow "Edit sideboxes" - When I follow "Add a block" - And I choose "Softwares" - And I press "Add" - Then I should see "softwares" + | name | public_software | finality | + | Public Software | true | some finality | + | Generic Software | false | some finality | + And the following blocks + | owner | type | + | mpog-admin | SoftwaresBlock | Scenario: Change software block to generic software block Given I follow "Control panel" And I follow "Edit sideboxes" - When I follow "Add a block" - And I choose "Softwares" - And I press "Add" + And I print the page And I follow "Edit" within ".softwares-block" - And I select "Generic" from "block_software_type" + When I select "Generic" from "block_software_type" And I press "Save" Then I should see "generic software" Scenario: Change software block to generic software block Given I follow "Control panel" And I follow "Edit sideboxes" - When I follow "Add a block" - And I choose "Softwares" - And I press "Add" And I follow "Edit" within ".softwares-block" - And I select "Public" from "block_software_type" + When I select "Public" from "block_software_type" And I press "Save" Then I should see "public software" diff --git a/src/noosfero-spb/software_communities/features/step_definitions/software_communities_steps.rb b/src/noosfero-spb/software_communities/features/step_definitions/software_communities_steps.rb index 35f27e1..4836d0b 100644 --- a/src/noosfero-spb/software_communities/features/step_definitions/software_communities_steps.rb +++ b/src/noosfero-spb/software_communities/features/step_definitions/software_communities_steps.rb @@ -252,6 +252,9 @@ Given /^I am logged in as mpog_admin$/ do user.person = person user.save! + person.user_id = user.id + person.save! + user.activate e = Environment.default e.add_admin(user.person) diff --git a/src/noosfero-spb/software_communities/features/use_report.feature b/src/noosfero-spb/software_communities/features/use_report.feature index 018b532..ad09f68 100644 --- a/src/noosfero-spb/software_communities/features/use_report.feature +++ b/src/noosfero-spb/software_communities/features/use_report.feature @@ -15,23 +15,17 @@ Feature: Use report And the following softwares | name | public_software | finality | | Noosfero | true | some finality | + And the following blocks + | owner | type | + | noosfero | OrganizationRatingsBlock | + | noosfero | AverageRatingBlock | - Scenario: Add Organization Ratings Block + Scenario: See Organization Ratings and Average Rating blocks Given I go to Noosfero's control panel And I follow "Edit sideboxes" - When I follow "Add a block" - And I choose "Organization Ratings" - And I press "Add" Then I should see "Report your experiences" - - Scenario: Add Average Rating Block - Given I go to Noosfero's control panel - And I follow "Edit sideboxes" - When I follow "Add a block" - And I choose "Organization Average Rating" - And I press "Add" - Then I should see "Be the first to rate!" - + And I should see "Be the first to rate!" + @selenium Scenario: Test Additional Fields JavaScript Given I go to /profile/noosfero/plugin/organization_ratings/new_rating @@ -47,11 +41,6 @@ Feature: Use report And the following public institutions | name | acronym | country | state | city | cnpj | juridical_nature | governmental_power | governmental_sphere | corporate_name | | Ministerio do Planejamento | MP | BR | Distrito Federal | Brasilia | 41.769.591/0001-43 | Autarquia | Judiciario | Federal | Ministerio do Planejamento | - And I go to Noosfero's control panel - And I follow "Edit sideboxes" - When I follow "Add a block" - And I choose "Organization Ratings" - And I press "Add" And I am on Noosfero's homepage And I follow "Rate Community" When I click on anything with selector "comments-additional-information" -- libgit2 0.21.2