Commit 3c93f5c072cd28983a404e178cd81a1d01aaae58

Authored by Fabio Teixeira
1 parent 82748c1c
Exists in master and in 79 other branches add_sisp_to_chef, add_super_archives_plugin, api_for_colab, automates_core_packing, backup_not_prod, changes_in_buttons_on_content_panel, colab_automated_login, colab_spb_plugin_recipe, colab_widgets_settings, design_validation, dev_env_minimal, disable_email_dev, fix_breadcrumbs_position, fix_categories_software_link, fix_edit_institution, fix_edit_software_with_another_license, fix_get_license_info, fix_gitlab_assets_permission, fix_list_style_inside_article, fix_list_style_on_folder_elements, fix_members_pagination, fix_merge_request_url, fix_models_translations, fix_no_license, fix_software_api, fix_software_block_migration, fix_software_communities_translations, fix_software_communities_unit_test, fix_style_create_institution_admin_panel, fix_superarchives_imports, fix_sym_links_noosfero, focus_search_field_theme, gov-user-refactoring, gov-user-refactoring-rails4, header_fix, institution_modal_on_rating, kalibro-conf-refactoring, kalibro-processor-package, lxc_settings, margin_fix, mezuro_cookbook, prezento, refactor_download_block, refactor_software_communities, refactor_software_for_sisp, register_page, release-process, release-process-v2, remove-unused-images, remove_broken_theme, remove_secondary_email_from_user, remove_sisp_buttons, removing_super_archives_email, review_message, scope2method, signals_user_noosfero, sisp_catalog_header, sisp_colab_config, sisp_dev, sisp_dev_master, sisp_simple_version, software_as_organization, software_catalog_style_fix, software_communities_html_refactor, software_infos_api, spb_minimal_env, spb_to_rails4, spec_refactor, stable-4.1, stable-4.2, stable-4.x, temp_soft_comm_refactoring, theme_header, theme_javascript_refactory, thread_dropdown, thread_page, update_search_by_categories, update_software_api, update_softwares_boxes

Fix broken unit, cucumber tests

Signed-off-by: Brenddon Gontijo <brenddongontijo@msn.com>
Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
features/steps_definitions/gov_user_steps.rb
... ... @@ -66,7 +66,6 @@ Given /^the following public institutions?$/ do |table|
66 66 end
67 67 end
68 68  
69   -
70 69 Given /^I sleep for (\d+) seconds$/ do |time|
71 70 sleep time.to_i
72 71 end
... ... @@ -87,4 +86,5 @@ Given /^I am logged in as mpog_admin$/ do
87 86 fill_in("Username", :with => user.login)
88 87 fill_in("Password", :with => '123456')
89 88 click_button("Log in")
90   -end
91 89 \ No newline at end of file
  90 +end
  91 +
... ...
test/unit/gov_user_person_test.rb
... ... @@ -15,6 +15,7 @@ class SoftwareCommunitiesPluginPersonTest &lt; ActiveSupport::TestCase
15 15 "user@email.com",
16 16 "123456",
17 17 "123456",
  18 + "user2@email.com",
18 19 "Any State",
19 20 "Some City"
20 21 )
... ...
test/unit/institution_test.rb
... ... @@ -29,34 +29,35 @@ class InstitutionTest &lt; ActiveSupport::TestCase
29 29 end
30 30 should "not save institutions without name" do
31 31 @institution.name = nil
32   - assert !@institution.save
33   - assert @institution.errors.full_messages.include? "Name can't be blank"
  32 + assert_equal false, @institution.save
  33 + assert_equal true, @institution.errors.full_messages.include?("Name can't be blank")
34 34 end
35 35  
36 36 should "not save if institution has invalid type" do
37 37 invalid_msg = "Type invalid, only public and private institutions are allowed."
38 38 @institution.type = "Other type"
39   - assert !@institution.save, 'Invalid type'
40   - assert @institution.errors.full_messages.include? invalid_msg
  39 + assert_equal false, @institution.save
  40 + assert_equal true, @institution.errors.full_messages.include?(invalid_msg)
41 41 end
42 42  
43 43 should "not save without country" do
44 44 @institution.community.country = nil
45   - assert !@institution.save, "Country can't be blank"
46   - assert @institution.errors.full_messages.include? "Country can't be blank"
  45 + assert_equal false, @institution.save
  46 + assert_equal true, @institution.errors.full_messages.include?("Country can't be blank")
47 47 end
48 48  
49 49 should "not save without state" do
50 50 @institution.community.state = nil
51 51  
52   - assert !@institution.save, "State can't be blank"
53   - assert @institution.errors.full_messages.include? "State can't be blank"
  52 + assert_equal false, @institution.save
  53 + assert_equal true, @institution.errors.full_messages.include?("State can't be blank")
54 54 end
55 55  
56 56 should "not save without city" do
57 57 @institution.community.city = nil
  58 + @institution.community.state = "DF"
58 59  
59   - assert !@institution.save, "City can't be blank"
60   - assert @institution.errors.full_messages.include? "City can't be blank"
  60 + assert_equal false, @institution.save
  61 + assert_equal true, @institution.errors.full_messages.include?("City can't be blank")
61 62 end
62 63 end
... ...