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 | 19 | And the following software databases |
20 | 20 | | database_name | version | operating_system | |
21 | 21 | | PostgreSQL | 1.0 | Linux | |
22 | + And the following operating systems | |
23 | + | operating_system_name | version | | |
24 | + | Debian | 1.0 | | |
22 | 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 | 28 | And I go to /plugin/mpog_software/archive_software |
26 | 29 | And I should see "teste" |
27 | 30 | And I follow "Deactivate software" |
... | ... | @@ -39,10 +42,13 @@ Feature: deactivate software |
39 | 42 | And the following software databases |
40 | 43 | | database_name | version | operating_system | |
41 | 44 | | PostgreSQL | 1.0 | Linux | |
45 | + And the following operating systems | |
46 | + | operating_system_name | version | | |
47 | + | Debian | 1.0 | | |
42 | 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 | 52 | And I should see "teste" |
47 | 53 | And I follow "Deactivate software" |
48 | 54 | And I confirm the "Do you want to deactivate this software?" dialog |
... | ... | @@ -54,7 +60,7 @@ Feature: deactivate software |
54 | 60 | And I should see "teste" |
55 | 61 | And I follow "Activate Software" |
56 | 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 | 64 | And I fill in "search-input" with "teste" |
59 | 65 | And I press "Search" |
60 | 66 | Then I should see "teste" within "search-profile-item" | ... | ... |
features/software_registration.feature
... | ... | @@ -53,7 +53,7 @@ Feature: software registration |
53 | 53 | Then I should not see "Operating platform can't be blank" |
54 | 54 | |
55 | 55 | @selenium |
56 | - Scenario: Show software_langue errors if this Version is blank | |
56 | + Scenario: Show software_language errors if version is blank | |
57 | 57 | Given I go to admin_user's control panel |
58 | 58 | And I follow "Manage my groups" |
59 | 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 | 13 | DatabaseDescription.create(:name => "Apache") |
14 | 14 | DatabaseDescription.create(:name => "PostgreSQL") |
15 | 15 | |
16 | - OperatingSystemName.create(:name=>"Debina") | |
16 | + OperatingSystemName.create(:name=>"Debian") | |
17 | 17 | OperatingSystemName.create(:name=>"Fedora") |
18 | 18 | OperatingSystemName.create(:name=>"CentOS") |
19 | 19 | end |
... | ... | @@ -70,6 +70,19 @@ Given /^the following software databases$/ do |table| |
70 | 70 | end |
71 | 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 | 86 | Given /^the following softwares$/ do |table| |
74 | 87 | table.hashes.each do |item| |
75 | 88 | community = Community.create :name=>item[:name] |
... | ... | @@ -79,10 +92,14 @@ Given /^the following softwares$/ do |table| |
79 | 92 | software_language = SoftwareLanguage.where(:programming_language_id=>programming_language).first |
80 | 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 | 98 | software_info = SoftwareInfo::new(:acronym=>item[:acronym], :operating_platform=>item[:operating_platform]) |
83 | 99 | software_info.community = community |
84 | 100 | software_info.software_languages << software_language |
85 | 101 | software_info.software_databases << software_database |
102 | + software_info.operating_systems << operating_system | |
86 | 103 | software_info.save! |
87 | 104 | end |
88 | 105 | end |
... | ... | @@ -130,4 +147,4 @@ end |
130 | 147 | |
131 | 148 | Given /^I sleep for (\d+) seconds$/ do |time| |
132 | 149 | sleep time.to_i |
133 | -end | |
134 | 150 | \ No newline at end of file |
151 | +end | ... | ... |