Commit 2f50cd62889c6bca89e78a3c28f515574e2d7b02
Exists in
master
and in
5 other branches
Merge branch 'master' of gitlab.com:softwarepublico/mpog_software
Showing
3 changed files
with
32 additions
and
9 deletions
Show diff stats
features/deactivate_software.feature
@@ -19,9 +19,12 @@ Feature: deactivate software | @@ -19,9 +19,12 @@ Feature: deactivate software | ||
19 | And the following software databases | 19 | And the following software databases |
20 | | database_name | version | operating_system | | 20 | | database_name | version | operating_system | |
21 | | PostgreSQL | 1.0 | Linux | | 21 | | PostgreSQL | 1.0 | Linux | |
22 | + And the following operating systems | ||
23 | + | operating_system_name | version | | ||
24 | + | Debian | 1.0 | | ||
22 | And the following softwares | 25 | And the following softwares |
23 | - | name | acronym | operating_platform | software_language | software_database | | ||
24 | - | teste | ts | I dont know | Python | PostgreSQL | | 26 | + | name | acronym | operating_platform | software_language | software_database | operating_system| |
27 | + | teste | ts | I dont know | Python | PostgreSQL | Debian | | ||
25 | And I go to /plugin/mpog_software/archive_software | 28 | And I go to /plugin/mpog_software/archive_software |
26 | And I should see "teste" | 29 | And I should see "teste" |
27 | And I follow "Deactivate software" | 30 | And I follow "Deactivate software" |
@@ -39,10 +42,13 @@ Feature: deactivate software | @@ -39,10 +42,13 @@ Feature: deactivate software | ||
39 | And the following software databases | 42 | And the following software databases |
40 | | database_name | version | operating_system | | 43 | | database_name | version | operating_system | |
41 | | PostgreSQL | 1.0 | Linux | | 44 | | PostgreSQL | 1.0 | Linux | |
45 | + And the following operating systems | ||
46 | + | operating_system_name | version | | ||
47 | + | Debian | 1.0 | | ||
42 | And the following softwares | 48 | And the following softwares |
43 | - | name | acronym | operating_platform | software_language | software_database | | ||
44 | - | teste | ts | I dont know | Python | PostgreSQL | | ||
45 | - And I go to /plugin/mpog_software/archive_software | 49 | + | name | acronym | operating_platform | software_language | software_database | operating_system| |
50 | + | teste | ts | I dont know | Python | PostgreSQL | Debian | | ||
51 | + And I go to /plugin/mpog_software/archive_software | ||
46 | And I should see "teste" | 52 | And I should see "teste" |
47 | And I follow "Deactivate software" | 53 | And I follow "Deactivate software" |
48 | And I confirm the "Do you want to deactivate this software?" dialog | 54 | And I confirm the "Do you want to deactivate this software?" dialog |
@@ -54,7 +60,7 @@ Feature: deactivate software | @@ -54,7 +60,7 @@ Feature: deactivate software | ||
54 | And I should see "teste" | 60 | And I should see "teste" |
55 | And I follow "Activate Software" | 61 | And I follow "Activate Software" |
56 | And I confirm the "Do you want to activate this software?" dialog | 62 | And I confirm the "Do you want to activate this software?" dialog |
57 | - And I follow "Communities" | 63 | + And I go to /search/communities |
58 | And I fill in "search-input" with "teste" | 64 | And I fill in "search-input" with "teste" |
59 | And I press "Search" | 65 | And I press "Search" |
60 | Then I should see "teste" within "search-profile-item" | 66 | Then I should see "teste" within "search-profile-item" |
features/software_registration.feature
@@ -53,7 +53,7 @@ Feature: software registration | @@ -53,7 +53,7 @@ Feature: software registration | ||
53 | Then I should not see "Operating platform can't be blank" | 53 | Then I should not see "Operating platform can't be blank" |
54 | 54 | ||
55 | @selenium | 55 | @selenium |
56 | - Scenario: Show software_langue errors if this Version is blank | 56 | + Scenario: Show software_language errors if version is blank |
57 | Given I go to admin_user's control panel | 57 | Given I go to admin_user's control panel |
58 | And I follow "Manage my groups" | 58 | And I follow "Manage my groups" |
59 | And I follow "Create a new software" | 59 | And I follow "Create a new software" |
features/step_definitions/mpog_steps.rb
@@ -13,7 +13,7 @@ Given /^SoftwareInfo has initial default values on database$/ do | @@ -13,7 +13,7 @@ Given /^SoftwareInfo has initial default values on database$/ do | ||
13 | DatabaseDescription.create(:name => "Apache") | 13 | DatabaseDescription.create(:name => "Apache") |
14 | DatabaseDescription.create(:name => "PostgreSQL") | 14 | DatabaseDescription.create(:name => "PostgreSQL") |
15 | 15 | ||
16 | - OperatingSystemName.create(:name=>"Debina") | 16 | + OperatingSystemName.create(:name=>"Debian") |
17 | OperatingSystemName.create(:name=>"Fedora") | 17 | OperatingSystemName.create(:name=>"Fedora") |
18 | OperatingSystemName.create(:name=>"CentOS") | 18 | OperatingSystemName.create(:name=>"CentOS") |
19 | end | 19 | end |
@@ -70,6 +70,19 @@ Given /^the following software databases$/ do |table| | @@ -70,6 +70,19 @@ Given /^the following software databases$/ do |table| | ||
70 | end | 70 | end |
71 | end | 71 | end |
72 | 72 | ||
73 | + | ||
74 | +Given /^the following operating systems$/ do |table| | ||
75 | + table.hashes.each do |item| | ||
76 | + operating_system_name = OperatingSystemName.where(:name=>item[:operating_system_name]).first | ||
77 | + operating_system = OperatingSystem::new | ||
78 | + | ||
79 | + operating_system.operating_system_name = operating_system_name | ||
80 | + operating_system.version = item[:version] | ||
81 | + | ||
82 | + operating_system.save! | ||
83 | + end | ||
84 | +end | ||
85 | + | ||
73 | Given /^the following softwares$/ do |table| | 86 | Given /^the following softwares$/ do |table| |
74 | table.hashes.each do |item| | 87 | table.hashes.each do |item| |
75 | community = Community.create :name=>item[:name] | 88 | community = Community.create :name=>item[:name] |
@@ -79,10 +92,14 @@ Given /^the following softwares$/ do |table| | @@ -79,10 +92,14 @@ Given /^the following softwares$/ do |table| | ||
79 | software_language = SoftwareLanguage.where(:programming_language_id=>programming_language).first | 92 | software_language = SoftwareLanguage.where(:programming_language_id=>programming_language).first |
80 | software_database = SoftwareDatabase.where(:database_description_id=>database_description).first | 93 | software_database = SoftwareDatabase.where(:database_description_id=>database_description).first |
81 | 94 | ||
95 | + operating_system_name = OperatingSystemName.where(:name => item[:operating_system]).first | ||
96 | + operating_system = OperatingSystem.where(:operating_system_name_id => operating_system_name).first | ||
97 | + | ||
82 | software_info = SoftwareInfo::new(:acronym=>item[:acronym], :operating_platform=>item[:operating_platform]) | 98 | software_info = SoftwareInfo::new(:acronym=>item[:acronym], :operating_platform=>item[:operating_platform]) |
83 | software_info.community = community | 99 | software_info.community = community |
84 | software_info.software_languages << software_language | 100 | software_info.software_languages << software_language |
85 | software_info.software_databases << software_database | 101 | software_info.software_databases << software_database |
102 | + software_info.operating_systems << operating_system | ||
86 | software_info.save! | 103 | software_info.save! |
87 | end | 104 | end |
88 | end | 105 | end |
@@ -130,4 +147,4 @@ end | @@ -130,4 +147,4 @@ end | ||
130 | 147 | ||
131 | Given /^I sleep for (\d+) seconds$/ do |time| | 148 | Given /^I sleep for (\d+) seconds$/ do |time| |
132 | sleep time.to_i | 149 | sleep time.to_i |
133 | -end | ||
134 | \ No newline at end of file | 150 | \ No newline at end of file |
151 | +end |