Commit ec80627d35a05eb68ede17dea1c58ff32bfcf2da

Authored by Fabio Teixeira
Committed by David Silva
1 parent 128ab2dd
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

Add selenium test to software's license info javascript behavior

Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com>
features/software_registration.feature
@@ -79,3 +79,17 @@ Feature: edit public software information @@ -79,3 +79,17 @@ Feature: edit public software information
79 Then I should see "Step 2/2 - Software Community Configuration" 79 Then I should see "Step 2/2 - Software Community Configuration"
80 And I go to /myprofile/new-software/profile_editor/edit 80 And I go to /myprofile/new-software/profile_editor/edit
81 Then I should not see "Step 2/2 - Software Community Configuration" 81 Then I should not see "Step 2/2 - Software Community Configuration"
  82 +
  83 + @selenium
  84 + Scenario: Show license link when a license is selected
  85 + Given I am on mpog-admin's control panel
  86 + And I follow "Create a new software"
  87 + And I fill in "community_name" with "another software"
  88 + And I fill in "software_info_finality" with "another software finality"
  89 + And I select "GPL-2" from "license_info_id"
  90 + And I should see "www.gpl2.com" within "#version_link"
  91 + And I press "Create"
  92 + And I go to another-software's control panel
  93 + And I follow "Software Info"
  94 + And I select "GPL-3" from "license_info_id"
  95 + Then I should see "www.gpl3.com" within "#version_link"
82 \ No newline at end of file 96 \ No newline at end of file
lib/tasks/create_lincences.rake
1 namespace :software do 1 namespace :software do
2 desc "Create software licences" 2 desc "Create software licences"
3 3
4 - task :create_licences => :environment do 4 + task :create_licenses => :environment do
5 Environment.all.each do |env| 5 Environment.all.each do |env|
6 if env.plugin_enabled?("MpogSoftware") or env.plugin_enabled?("MpogSoftwarePlugin") 6 if env.plugin_enabled?("MpogSoftware") or env.plugin_enabled?("MpogSoftwarePlugin")
7 list_file = File.open "plugins/mpog_software/public/static/licences.txt", "r" 7 list_file = File.open "plugins/mpog_software/public/static/licences.txt", "r"
views/mpog_software_plugin_myprofile/_main_software_editor_extras.html.erb
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 12
13 <h3> <%= _("Licenses") %> </h3> 13 <h3> <%= _("Licenses") %> </h3>
14 <div id='licenses'> 14 <div id='licenses'>
15 - <%= select_tag("license[license_infos_id]", options_for_select(LicenseHelper.getListLicenses.collect{|l| [l.version, l.id]}, :selected => @profile.software_info.license_info_id), :id => "license_info_version") %> 15 + <%= select_tag("license[license_infos_id]", options_for_select(LicenseHelper.getListLicenses.collect{|l| [l.version, l.id]}, :selected => @profile.software_info.license_info_id), :id => "license_info_id") %>
16 <br /> 16 <br />
17 17
18 <h4> <%= _("License link") %> </h4> 18 <h4> <%= _("License link") %> </h4>