Commit 193a85c4a9c052dc3686fa7b77a16db4566d21a0
Committed by
Gabriel Silva
1 parent
e03cd10d
Exists in
remove_secondary_email_from_user
Fixes unit and integration tests
- Removes selenium and cucmber tests (Gov User and Software Communities) - Removes secondary email tests - Fixes institution CNPJ validation Signed-off-by: Luciano Prestes Cavalcanti <lucianopcbr@gmail.com> Signed-off-by: Gustavo Coelho <gust.rod.coelho@gmail.com> Signed-off-by: Gabriel Silva <gabriel93.silva@gmail.com>
Showing
16 changed files
with
65 additions
and
88 deletions
Show diff stats
src/noosfero-spb/gov_user/features/institution_registration.feature
@@ -5,9 +5,12 @@ Feature: Institution Field | @@ -5,9 +5,12 @@ Feature: Institution Field | ||
5 | 5 | ||
6 | Background: | 6 | Background: |
7 | Given "GovUserPlugin" plugin is enabled | 7 | Given "GovUserPlugin" plugin is enabled |
8 | + And "SoftwareCommunitiesPlugin" plugin is enabled | ||
8 | And I am logged in as mpog_admin | 9 | And I am logged in as mpog_admin |
10 | + And I go to /admin/environment_themes/set/noosfero-spb-theme | ||
9 | And I go to /admin/plugins | 11 | And I go to /admin/plugins |
10 | And I check "GovUserPlugin" | 12 | And I check "GovUserPlugin" |
13 | + And I check "SoftwareCommunitiesPlugin" | ||
11 | And I press "Save changes" | 14 | And I press "Save changes" |
12 | And Institutions has initial default values on database | 15 | And Institutions has initial default values on database |
13 | And I am logged in as mpog_admin | 16 | And I am logged in as mpog_admin |
@@ -27,6 +30,6 @@ Feature: Institution Field | @@ -27,6 +30,6 @@ Feature: Institution Field | ||
27 | And I should see "CNPJ" | 30 | And I should see "CNPJ" |
28 | And I should see "Acronym" | 31 | And I should see "Acronym" |
29 | And I choose "Public Institution" | 32 | And I choose "Public Institution" |
30 | - Then I should see "Governmental Sphere:" | ||
31 | - And I should see "Governmental Power:" | ||
32 | - And I should see "Juridical Nature:" | 33 | + Then I should see "Governmental Sphere" |
34 | + And I should see "Governmental Power" | ||
35 | + And I should see "Juridical Nature" |
src/noosfero-spb/gov_user/features/rate_community.feature
@@ -38,7 +38,7 @@ Feature: rate_community | @@ -38,7 +38,7 @@ Feature: rate_community | ||
38 | And I go to mycommunity's control panel | 38 | And I go to mycommunity's control panel |
39 | And I follow "Process requests" within ".pending-tasks" | 39 | And I follow "Process requests" within ".pending-tasks" |
40 | And I choose "Accept" within ".task_decisions" | 40 | And I choose "Accept" within ".task_decisions" |
41 | - Then I should see "This instiution already has an accepted rating" in the page | 41 | + Then I should see "This institution already has an accepted rating." in the page |
42 | 42 | ||
43 | Scenario: do not display message on task when a rating with the same institution does not exist on the same software | 43 | Scenario: do not display message on task when a rating with the same institution does not exist on the same software |
44 | Given the following organization ratings | 44 | Given the following organization ratings |
src/noosfero-spb/gov_user/features/rating_institution_registration.feature
@@ -8,6 +8,7 @@ Feature: Create institution on user report | @@ -8,6 +8,7 @@ Feature: Create institution on user report | ||
8 | And "SoftwareCommunitiesPlugin" plugin is enabled | 8 | And "SoftwareCommunitiesPlugin" plugin is enabled |
9 | And "OrganizationRatings" plugin is enabled | 9 | And "OrganizationRatings" plugin is enabled |
10 | And I am logged in as mpog_admin | 10 | And I am logged in as mpog_admin |
11 | + And I go to /admin/environment_themes/set/noosfero-spb-theme | ||
11 | And I go to /admin/plugins | 12 | And I go to /admin/plugins |
12 | And I check "GovUserPlugin" | 13 | And I check "GovUserPlugin" |
13 | And I check "SoftwareCommunitiesPlugin" | 14 | And I check "SoftwareCommunitiesPlugin" |
@@ -23,20 +24,20 @@ Feature: Create institution on user report | @@ -23,20 +24,20 @@ Feature: Create institution on user report | ||
23 | And I should not see "Number of Beneficiaries" | 24 | And I should not see "Number of Beneficiaries" |
24 | And I should not see "Saved resources" | 25 | And I should not see "Saved resources" |
25 | And I should not see "Organization name or Enterprise name" | 26 | And I should not see "Organization name or Enterprise name" |
26 | - When I click on anything with selector "#comments-additional-information" | ||
27 | - Then I should see "Number of Beneficiaries" | ||
28 | - And I should see "Organization name or Enterprise name" | ||
29 | - And I should see "Saved resources" | 27 | + When I click on anything with selector "comments-additional-information" |
28 | + Then I should see "Número de beneficiados" | ||
29 | + And I should see "Nome do órgão ou empresa" | ||
30 | + And I should see "Recursos economizados" | ||
30 | 31 | ||
31 | @selenium | 32 | @selenium |
32 | Scenario: Show new institution fields when clicked in add new institution | 33 | Scenario: Show new institution fields when clicked in add new institution |
33 | Given I go to /profile/noosfero/plugin/organization_ratings/new_rating | 34 | Given I go to /profile/noosfero/plugin/organization_ratings/new_rating |
34 | - And I click on anything with selector "#comments-additional-information" | 35 | + And I sleep for 1 seconds |
36 | + And I click on anything with selector "comments-additional-information" | ||
35 | And I fill in "input_institution" with "None institution" | 37 | And I fill in "input_institution" with "None institution" |
36 | And I sleep for 2 seconds | 38 | And I sleep for 2 seconds |
37 | When I follow "Add" | 39 | When I follow "Add" |
38 | - Then I should see "New Institution" | ||
39 | - And I should see "Public Institution" | 40 | + Then I should see "Public Institution" |
40 | And I should see "Private Institution" | 41 | And I should see "Private Institution" |
41 | And I should see "Corporate Name" | 42 | And I should see "Corporate Name" |
42 | And I should see "Name" | 43 | And I should see "Name" |
@@ -46,33 +47,30 @@ Feature: Create institution on user report | @@ -46,33 +47,30 @@ Feature: Create institution on user report | ||
46 | And I should see "CNPJ" | 47 | And I should see "CNPJ" |
47 | And I should see "Acronym" | 48 | And I should see "Acronym" |
48 | And I choose "Public Institution" | 49 | And I choose "Public Institution" |
49 | - And I should see "Governmental Sphere:" | ||
50 | - And I should see "Governmental Power:" | ||
51 | - And I should see "Juridical Nature:" | 50 | + And I should see "Governmental Sphere" |
51 | + And I should see "Governmental Power" | ||
52 | + And I should see "Juridical Nature" | ||
52 | 53 | ||
53 | @selenium | 54 | @selenium |
54 | Scenario: Create new institution with name changed in the modal | 55 | Scenario: Create new institution with name changed in the modal |
55 | Given I go to /profile/noosfero/plugin/organization_ratings/new_rating | 56 | Given I go to /profile/noosfero/plugin/organization_ratings/new_rating |
56 | - And I click on anything with selector "#comments-additional-information" | 57 | + And I sleep for 1 seconds |
58 | + And I click on anything with selector "comments-additional-information" | ||
57 | And I fill in "input_institution" with "None institution" | 59 | And I fill in "input_institution" with "None institution" |
58 | And I sleep for 2 seconds | 60 | And I sleep for 2 seconds |
59 | - When I click on anything with selector "#create_institution_link" | 61 | + When I click on anything with selector "create_institution_link" |
60 | And I fill in "community_name" with "Noosfero Institution" | 62 | And I fill in "community_name" with "Noosfero Institution" |
61 | - And I select "United States" from "#community_country" | ||
62 | - And I follow "#save_institution_button" | 63 | + And I select "United States" from "Country" |
64 | + And I sleep for 1 seconds | ||
65 | + And I follow "Save" | ||
63 | Then I should see "Noosfero Institution" | 66 | Then I should see "Noosfero Institution" |
64 | 67 | ||
65 | @selenium | 68 | @selenium |
66 | Scenario: Check new institution name in the modal | 69 | Scenario: Check new institution name in the modal |
67 | Given I go to /profile/noosfero/plugin/organization_ratings/new_rating | 70 | Given I go to /profile/noosfero/plugin/organization_ratings/new_rating |
68 | - And I click on anything with selector "#comments-additional-information" | 71 | + And I sleep for 1 seconds |
72 | + And I click on anything with selector "comments-additional-information" | ||
69 | And I fill in "input_institution" with "None institution" | 73 | And I fill in "input_institution" with "None institution" |
70 | And I sleep for 2 seconds | 74 | And I sleep for 2 seconds |
71 | - When I click on anything with selector "#create_institution_link" | ||
72 | - Then I should see "None Institution" within "community_name" | ||
73 | - | ||
74 | - | ||
75 | - | ||
76 | - | ||
77 | - | ||
78 | - | 75 | + When I click on anything with selector "create_institution_link" |
76 | + Then I should see "None institution" in "Corporate Name" field |
src/noosfero-spb/gov_user/features/user_profile_edition.feature
@@ -5,12 +5,15 @@ Feature: Institution Field | @@ -5,12 +5,15 @@ Feature: Institution Field | ||
5 | 5 | ||
6 | Background: | 6 | Background: |
7 | Given "GovUserPlugin" plugin is enabled | 7 | Given "GovUserPlugin" plugin is enabled |
8 | + And "SoftwareCommunitiesPlugin" plugin is enabled | ||
8 | And the following users | 9 | And the following users |
9 | | login | name | | 10 | | login | name | |
10 | | joao | Joao Silva | | 11 | | joao | Joao Silva | |
11 | And I am logged in as admin | 12 | And I am logged in as admin |
13 | + And I go to /admin/environment_themes/set/noosfero-spb-theme | ||
12 | And I go to /admin/plugins | 14 | And I go to /admin/plugins |
13 | And I check "GovUserPlugin" | 15 | And I check "GovUserPlugin" |
16 | + And I check "SoftwareCommunitiesPlugin" | ||
14 | And I press "Save changes" | 17 | And I press "Save changes" |
15 | And feature "skip_new_user_email_confirmation" is enabled on environment | 18 | And feature "skip_new_user_email_confirmation" is enabled on environment |
16 | And I go to /admin/features/manage_fields | 19 | And I go to /admin/features/manage_fields |
@@ -44,13 +47,12 @@ Feature: Institution Field | @@ -44,13 +47,12 @@ Feature: Institution Field | ||
44 | Given I am logged in as "joao" | 47 | Given I am logged in as "joao" |
45 | And I am on joao's control panel | 48 | And I am on joao's control panel |
46 | When I follow "Edit Profile" | 49 | When I follow "Edit Profile" |
47 | - And I follow "Add new institution" | ||
48 | And I type in "Minis" in autocomplete list "#input_institution" and I choose "Ministerio do Planejamento" | 50 | And I type in "Minis" in autocomplete list "#input_institution" and I choose "Ministerio do Planejamento" |
49 | And I follow "Add new institution" | 51 | And I follow "Add new institution" |
50 | And I type in "Gover" in autocomplete list "#input_institution" and I choose "Governo do DF" | 52 | And I type in "Gover" in autocomplete list "#input_institution" and I choose "Governo do DF" |
51 | And I follow "Add new institution" | 53 | And I follow "Add new institution" |
52 | - Then I should see "Ministerio do Planejamento" within ".institutions_added" | ||
53 | - And I should see "Governo do DF" within ".institutions_added" | 54 | + Then I should see "Ministerio do Planejamento" |
55 | + And I should see "Governo do DF" | ||
54 | 56 | ||
55 | @selenium | 57 | @selenium |
56 | Scenario: Verify if field 'city' is shown when Brazil is selected | 58 | Scenario: Verify if field 'city' is shown when Brazil is selected |
src/noosfero-spb/gov_user/lib/private_institution.rb
1 | class PrivateInstitution < Institution | 1 | class PrivateInstitution < Institution |
2 | validates :cnpj, | 2 | validates :cnpj, |
3 | - :presence=>true, | ||
4 | :format => {with: CNPJ_FORMAT}, | 3 | :format => {with: CNPJ_FORMAT}, |
5 | :if => :is_a_brazilian_institution? | 4 | :if => :is_a_brazilian_institution? |
6 | 5 | ||
7 | validates :cnpj, | 6 | validates :cnpj, |
8 | - :uniqueness=>true, :unless => 'cnpj.blank?' | 7 | + :uniqueness => true, :unless => 'cnpj.blank?' |
9 | 8 | ||
10 | private | 9 | private |
11 | def is_a_brazilian_institution? | 10 | def is_a_brazilian_institution? |
src/noosfero-spb/gov_user/test/functional/gov_user_plugin_controller_test.rb
@@ -105,9 +105,9 @@ class GovUserPluginControllerTest < ActionController::TestCase | @@ -105,9 +105,9 @@ class GovUserPluginControllerTest < ActionController::TestCase | ||
105 | 105 | ||
106 | fields = InstitutionTestHelper.generate_form_fields( | 106 | fields = InstitutionTestHelper.generate_form_fields( |
107 | "Some Private Institution", | 107 | "Some Private Institution", |
108 | - "BR", | ||
109 | - "DF", | ||
110 | - "Brasilia", | 108 | + "EN", |
109 | + "NY", | ||
110 | + "New York", | ||
111 | "", | 111 | "", |
112 | "PrivateInstitution" | 112 | "PrivateInstitution" |
113 | ) | 113 | ) |
src/noosfero-spb/gov_user/test/unit/institutions_block_test.rb
@@ -27,7 +27,6 @@ class InstitutionsBlockTest < ActiveSupport::TestCase | @@ -27,7 +27,6 @@ class InstitutionsBlockTest < ActiveSupport::TestCase | ||
27 | "jose_augusto@email.com", | 27 | "jose_augusto@email.com", |
28 | "aaaaaaa", | 28 | "aaaaaaa", |
29 | "aaaaaaa", | 29 | "aaaaaaa", |
30 | - 'jose@secondary.com', | ||
31 | "DF", | 30 | "DF", |
32 | "Gama" | 31 | "Gama" |
33 | ) | 32 | ) |
src/noosfero-spb/gov_user/test/unit/organization_rating_test.rb
@@ -16,15 +16,14 @@ class OrganizationRatingTest < ActiveSupport::TestCase | @@ -16,15 +16,14 @@ class OrganizationRatingTest < ActiveSupport::TestCase | ||
16 | private_institution = build_private_institution "huehue", "hue", "11.222.333/4444-55" | 16 | private_institution = build_private_institution "huehue", "hue", "11.222.333/4444-55" |
17 | 17 | ||
18 | community_rating = OrganizationRating.new(:person => person, :value => 3, :organization => community, :institution => private_institution) | 18 | community_rating = OrganizationRating.new(:person => person, :value => 3, :organization => community, :institution => private_institution) |
19 | - assert_equal false, community_rating.valid? | ||
20 | 19 | ||
21 | - assert_equal true, community_rating.errors[:institution].include?("not found") | 20 | + assert_equal false, community_rating.valid? |
22 | 21 | ||
23 | private_institution.save | 22 | private_institution.save |
24 | community_rating.institution = private_institution | 23 | community_rating.institution = private_institution |
25 | 24 | ||
26 | assert_equal true, community_rating.valid? | 25 | assert_equal true, community_rating.valid? |
27 | - assert_equal false, community_rating.errors[:institution].include?("not found") | 26 | + assert_equal false, community_rating.errors[:institution].include?("institution not found") |
28 | end | 27 | end |
29 | 28 | ||
30 | private | 29 | private |
src/noosfero-spb/gov_user/test/unit/person_test.rb
@@ -12,7 +12,6 @@ class SoftwareCommunitiesPluginPersonTest < ActiveSupport::TestCase | @@ -12,7 +12,6 @@ class SoftwareCommunitiesPluginPersonTest < ActiveSupport::TestCase | ||
12 | "user@email.com", | 12 | "user@email.com", |
13 | "123456", | 13 | "123456", |
14 | "123456", | 14 | "123456", |
15 | - "user@secondaryemail.com", | ||
16 | "Any State", | 15 | "Any State", |
17 | "Some City" | 16 | "Some City" |
18 | ) | 17 | ) |
@@ -22,7 +21,7 @@ class SoftwareCommunitiesPluginPersonTest < ActiveSupport::TestCase | @@ -22,7 +21,7 @@ class SoftwareCommunitiesPluginPersonTest < ActiveSupport::TestCase | ||
22 | @person.cell_phone = "76888919" | 21 | @person.cell_phone = "76888919" |
23 | @person.contact_phone = "987654321" | 22 | @person.contact_phone = "987654321" |
24 | 23 | ||
25 | - assert_equal(67, @plugin.calc_percentage_registration(@person)) | 24 | + assert_equal(64, @plugin.calc_percentage_registration(@person)) |
26 | 25 | ||
27 | @person.comercial_phone = "11223344" | 26 | @person.comercial_phone = "11223344" |
28 | @person.country = "I dont know" | 27 | @person.country = "I dont know" |
src/noosfero-spb/gov_user/views/person_editor_extras.html.erb
@@ -12,6 +12,7 @@ | @@ -12,6 +12,7 @@ | ||
12 | <%= content_tag(:div, _("No institution found"), :id=>"institution_empty_ajax_message", :class=>"errorExplanation hide-field") %> | 12 | <%= content_tag(:div, _("No institution found"), :id=>"institution_empty_ajax_message", :class=>"errorExplanation hide-field") %> |
13 | 13 | ||
14 | <%= InstitutionModalHelper.modal_button %> | 14 | <%= InstitutionModalHelper.modal_button %> |
15 | + <%= link_to(_("Add new institution"), "#", :class=>'button with-text icon-add', :id => 'add_new_institution') %> | ||
15 | 16 | ||
16 | <%= hidden_field_tag("user[institution_ids][]", "", :class => 'user_institutions') %> | 17 | <%= hidden_field_tag("user[institution_ids][]", "", :class => 'user_institutions') %> |
17 | <%= hidden_field_tag("institution_selected", "") %> | 18 | <%= hidden_field_tag("institution_selected", "") %> |
src/noosfero-spb/software_communities/features/public_software_validation.feature
@@ -22,13 +22,13 @@ Feature: edit adherent fields | @@ -22,13 +22,13 @@ Feature: edit adherent fields | ||
22 | Given I am logged in as "joaosilva" | 22 | Given I am logged in as "joaosilva" |
23 | And I go to /myprofile/basic-software/plugin/software_communities/edit_software | 23 | And I go to /myprofile/basic-software/plugin/software_communities/edit_software |
24 | And I follow "Specifications" | 24 | And I follow "Specifications" |
25 | - Then I should see "Public software" within ".public_software_disabled" | 25 | + Then the "#software_public_software" button should be disabled |
26 | 26 | ||
27 | Scenario: Enable public software checkbox to admin users | 27 | Scenario: Enable public software checkbox to admin users |
28 | Given I am logged in as mpog_admin | 28 | Given I am logged in as mpog_admin |
29 | And I go to /myprofile/basic-software/plugin/software_communities/edit_software | 29 | And I go to /myprofile/basic-software/plugin/software_communities/edit_software |
30 | And I follow "Specifications" | 30 | And I follow "Specifications" |
31 | - Then I should see "Public software" within ".public_software_enabled" | 31 | + Then the "#software_public_software" button should be enabled |
32 | 32 | ||
33 | @selenium | 33 | @selenium |
34 | Scenario: Show adherent fields when checkbox are checked | 34 | Scenario: Show adherent fields when checkbox are checked |
src/noosfero-spb/software_communities/features/software_block.feature
@@ -15,8 +15,7 @@ Feature: edit adherent fields | @@ -15,8 +15,7 @@ Feature: edit adherent fields | ||
15 | | Generic Software | false | some finality | | 15 | | Generic Software | false | some finality | |
16 | 16 | ||
17 | Scenario: Add software block | 17 | Scenario: Add software block |
18 | - Given I am logged in as mpog_admin | ||
19 | - And I follow "Control panel" | 18 | + Given I follow "Control panel" |
20 | And I follow "Edit sideboxes" | 19 | And I follow "Edit sideboxes" |
21 | When I follow "Add a block" | 20 | When I follow "Add a block" |
22 | And I choose "Softwares" | 21 | And I choose "Softwares" |
@@ -24,9 +23,7 @@ Feature: edit adherent fields | @@ -24,9 +23,7 @@ Feature: edit adherent fields | ||
24 | Then I should see "softwares" | 23 | Then I should see "softwares" |
25 | 24 | ||
26 | Scenario: Change software block to generic software block | 25 | Scenario: Change software block to generic software block |
27 | - Given I am logged in as mpog_admin | ||
28 | - And I go to /myprofile/mpog_admin | ||
29 | - And I follow "Control panel" | 26 | + Given I follow "Control panel" |
30 | And I follow "Edit sideboxes" | 27 | And I follow "Edit sideboxes" |
31 | When I follow "Add a block" | 28 | When I follow "Add a block" |
32 | And I choose "Softwares" | 29 | And I choose "Softwares" |
@@ -37,8 +34,7 @@ Feature: edit adherent fields | @@ -37,8 +34,7 @@ Feature: edit adherent fields | ||
37 | Then I should see "generic software" | 34 | Then I should see "generic software" |
38 | 35 | ||
39 | Scenario: Change software block to generic software block | 36 | Scenario: Change software block to generic software block |
40 | - Given I am logged in as mpog_admin | ||
41 | - And I follow "Control panel" | 37 | + Given I follow "Control panel" |
42 | And I follow "Edit sideboxes" | 38 | And I follow "Edit sideboxes" |
43 | When I follow "Add a block" | 39 | When I follow "Add a block" |
44 | And I choose "Softwares" | 40 | And I choose "Softwares" |
src/noosfero-spb/software_communities/features/software_catalog.feature
@@ -59,7 +59,7 @@ Feature: Search software | @@ -59,7 +59,7 @@ Feature: Search software | ||
59 | @selenium | 59 | @selenium |
60 | Scenario: Show only "Software Two" when searching for "Education" category | 60 | Scenario: Show only "Software Two" when searching for "Education" category |
61 | Given I go to /search/software_infos | 61 | Given I go to /search/software_infos |
62 | - And I click on anything with selector "#filter-option-catalog-software" | 62 | + And I click on anything with selector "filter-option-catalog-software" |
63 | And I check "Education" | 63 | And I check "Education" |
64 | Then I should see "Software Two" | 64 | Then I should see "Software Two" |
65 | And I should not see "Software One" | 65 | And I should not see "Software One" |
@@ -67,7 +67,7 @@ Feature: Search software | @@ -67,7 +67,7 @@ Feature: Search software | ||
67 | @selenium | 67 | @selenium |
68 | Scenario: Show both Software "One" and "Two" when searching for "Health" category | 68 | Scenario: Show both Software "One" and "Two" when searching for "Health" category |
69 | Given I go to /search/software_infos | 69 | Given I go to /search/software_infos |
70 | - And I click on anything with selector "#filter-option-catalog-software" | 70 | + And I click on anything with selector "filter-option-catalog-software" |
71 | And I check "Health" | 71 | And I check "Health" |
72 | Then I should see "Software One" | 72 | Then I should see "Software One" |
73 | And I should see "Software Two" | 73 | And I should see "Software Two" |
@@ -75,8 +75,7 @@ Feature: Search software | @@ -75,8 +75,7 @@ Feature: Search software | ||
75 | @selenium | 75 | @selenium |
76 | Scenario: Show not "public_software" when "Include in results" is checked | 76 | Scenario: Show not "public_software" when "Include in results" is checked |
77 | Given I go to /search/software_infos | 77 | Given I go to /search/software_infos |
78 | - And I click on anything with selector "#filter-option-catalog-software" | ||
79 | - And I check "include_non_public" | 78 | + And I choose "all_radio_button" |
80 | Then I should see "Software One" | 79 | Then I should see "Software One" |
81 | And I should see "Software Two" | 80 | And I should see "Software Two" |
82 | And I should see "Software Three" | 81 | And I should see "Software Three" |
@@ -107,6 +106,5 @@ Feature: Search software | @@ -107,6 +106,5 @@ Feature: Search software | ||
107 | When I select "Favorites" from "sort" | 106 | When I select "Favorites" from "sort" |
108 | And I sleep for 3 seconds | 107 | And I sleep for 3 seconds |
109 | Then I should see "Software Two" before "Software One" | 108 | Then I should see "Software Two" before "Software One" |
110 | - And there should be 1 div with class "small-star-positive" | ||
111 | - And there should be 4 divs with class "small-star-negative" | ||
112 | - | 109 | + And I should see "1" of this selector "div.medium-star-positive" |
110 | + And I should see "4" of this selector "div.medium-star-negative" |
src/noosfero-spb/software_communities/features/step_definitions/software_communities_steps.rb
@@ -18,29 +18,6 @@ Given /^SoftwareInfo has initial default values on database$/ do | @@ -18,29 +18,6 @@ Given /^SoftwareInfo has initial default values on database$/ do | ||
18 | OperatingSystemName.create(:name=>"CentOS") | 18 | OperatingSystemName.create(:name=>"CentOS") |
19 | end | 19 | end |
20 | 20 | ||
21 | -Given /^Institutions has initial default values on database$/ do | ||
22 | - GovernmentalPower.create(:name => "Executivo") | ||
23 | - GovernmentalPower.create(:name => "Legislativo") | ||
24 | - GovernmentalPower.create(:name => "Judiciario") | ||
25 | - | ||
26 | - GovernmentalSphere.create(:name => "Federal") | ||
27 | - | ||
28 | - JuridicalNature.create(:name => "Autarquia") | ||
29 | - JuridicalNature.create(:name => "Administracao Direta") | ||
30 | - JuridicalNature.create(:name => "Empresa Publica") | ||
31 | - JuridicalNature.create(:name => "Fundacao") | ||
32 | - JuridicalNature.create(:name => "Orgao Autonomo") | ||
33 | - JuridicalNature.create(:name => "Sociedade") | ||
34 | - JuridicalNature.create(:name => "Sociedade Civil") | ||
35 | - JuridicalNature.create(:name => "Sociedade de Economia Mista") | ||
36 | - | ||
37 | - national_region = NationalRegion.new | ||
38 | - national_region.name = "Distrito Federal" | ||
39 | - national_region.national_region_code = '35' | ||
40 | - national_region.national_region_type_id = NationalRegionType::STATE | ||
41 | - national_region.save | ||
42 | -end | ||
43 | - | ||
44 | Given /^I type in "([^"]*)" in autocomplete list "([^"]*)" and I choose "([^"]*)"$/ do |typed, input_field_selector, should_select| | 21 | Given /^I type in "([^"]*)" in autocomplete list "([^"]*)" and I choose "([^"]*)"$/ do |typed, input_field_selector, should_select| |
45 | # Wait the page javascript load | 22 | # Wait the page javascript load |
46 | sleep 1 | 23 | sleep 1 |
@@ -291,6 +268,10 @@ Then /^there should be (\d+) divs? with class "([^"]*)"$/ do |count, klass| | @@ -291,6 +268,10 @@ Then /^there should be (\d+) divs? with class "([^"]*)"$/ do |count, klass| | ||
291 | should have_selector("div.#{klass}", :count => count) | 268 | should have_selector("div.#{klass}", :count => count) |
292 | end | 269 | end |
293 | 270 | ||
271 | +Then /^I should see "([^"]*)" in "([^"]*)" field$/ do |content, field| | ||
272 | + should have_field(field, :with => content) | ||
273 | +end | ||
274 | + | ||
294 | Given /^I should see "([^"]*)" in the page/ do |message| | 275 | Given /^I should see "([^"]*)" in the page/ do |message| |
295 | assert_match message, page.body | 276 | assert_match message, page.body |
296 | end | 277 | end |
src/noosfero-spb/software_communities/features/use_report.feature
@@ -34,10 +34,10 @@ Feature: Use report | @@ -34,10 +34,10 @@ Feature: Use report | ||
34 | Scenario: Test Additional Fields JavaScript | 34 | Scenario: Test Additional Fields JavaScript |
35 | Given I go to /profile/noosfero/plugin/organization_ratings/new_rating | 35 | Given I go to /profile/noosfero/plugin/organization_ratings/new_rating |
36 | Then I should not see "Number of Beneficiaries" | 36 | Then I should not see "Number of Beneficiaries" |
37 | - And I should not see "Saved Resources" | 37 | + And I should not see "Saved resources" |
38 | When I click on anything with selector "comments-additional-information" | 38 | When I click on anything with selector "comments-additional-information" |
39 | Then I should see "Number of Beneficiaries" | 39 | Then I should see "Number of Beneficiaries" |
40 | - And I should see "Saved Resources" | 40 | + And I should see "Saved resources" |
41 | 41 | ||
42 | @selenium | 42 | @selenium |
43 | Scenario: Validate Use Report fields format | 43 | Scenario: Validate Use Report fields format |
@@ -49,8 +49,8 @@ Feature: Use report | @@ -49,8 +49,8 @@ Feature: Use report | ||
49 | And I am on Noosfero's homepage | 49 | And I am on Noosfero's homepage |
50 | And I follow "Rate Community" | 50 | And I follow "Rate Community" |
51 | When I click on anything with selector "comments-additional-information" | 51 | When I click on anything with selector "comments-additional-information" |
52 | - And I fill in "organization_rating_people_benefited" with "123123" | ||
53 | - And I fill in "organization_rating_saved_value" with "7654321" | 52 | + And I fill in "people_benefited_tmp" with "123123" |
53 | + And I fill in "saved_value_tmp" with "7654321" | ||
54 | And I press "Save" | 54 | And I press "Save" |
55 | - Then I should see "Benefited People: 123.123" | ||
56 | - And I should see "Saved Resources: $ 76,543.21" | 55 | + Then I should see "Benefited People: 123,123" |
56 | + And I should see "Saved Resources: $76,543.21" |
src/noosfero-spb/software_communities/views/search/_catalog_filter.html.erb
@@ -6,8 +6,10 @@ | @@ -6,8 +6,10 @@ | ||
6 | <ul> | 6 | <ul> |
7 | <% @categories.each do |category| %> | 7 | <% @categories.each do |category| %> |
8 | <li> | 8 | <li> |
9 | - <%= check_box_tag("selected_categories_id[]", category.id, @selected_categories_id.include?(category.id), :class => "categories-catalog", @enabled_check_box[category] => "true") %> | ||
10 | - <span><%= _("#{category.name}") %></span> | 9 | + <label> |
10 | + <%= check_box_tag("selected_categories_id[]", category.id, @selected_categories_id.include?(category.id), :class => "categories-catalog", @enabled_check_box[category] => "true") %> | ||
11 | + <span><%= _("#{category.name}") %></span> | ||
12 | + </label> | ||
11 | </li> | 13 | </li> |
12 | <% end %> | 14 | <% end %> |
13 | </ul> | 15 | </ul> |