Commit 94993587d15ba49f2a5ddbab51b3d632fdc14c0b
Committed by
Paulo Meireles
1 parent
44e8c85f
Exists in
master
and in
29 other branches
[Mezuro] More acceptance tests on repository.feature. Still working on it.
Showing
2 changed files
with
38 additions
and
15 deletions
Show diff stats
features/step_definitions/mezuro_steps.rb
... | ... | @@ -43,7 +43,7 @@ Then /^I should not see "([^"]*)" button$/ do |button_name| |
43 | 43 | find_button(button_name).should be_nil |
44 | 44 | end |
45 | 45 | |
46 | -When /^I have a Mezuro (project|reading group) with the following data$/ do |type,fields| | |
46 | +When /^I have a Mezuro (project|reading group|configuration) with the following data$/ do |type,fields| | |
47 | 47 | item = {} |
48 | 48 | fields.rows_hash.each do |name, value| |
49 | 49 | if(name=="user" or name=="community") |
... | ... | @@ -52,22 +52,16 @@ When /^I have a Mezuro (project|reading group) with the following data$/ do |typ |
52 | 52 | item.merge!(name => value) |
53 | 53 | end |
54 | 54 | end |
55 | - if(type=="project") | |
55 | + if (type == "project") | |
56 | 56 | result = MezuroPlugin::ProjectContent.new(item) |
57 | - elsif(type=="reading group") | |
57 | + elsif (type == "reading group") | |
58 | 58 | result = MezuroPlugin::ReadingGroupContent.new(item) |
59 | + elsif (type == "configuration") | |
60 | + result = MezuroPlugin::ConfigurationContent.new(item) | |
59 | 61 | end |
60 | 62 | result.save! |
61 | 63 | end |
62 | 64 | |
63 | -When /^I have a configuration with the following data$/ do |fields| | |
64 | - attributes = {} | |
65 | - fields.rows_hash.each do |name, value| | |
66 | - attributes.merge!(name => value) | |
67 | - end | |
68 | - Kalibro::Configuration.create(attributes) | |
69 | -end | |
70 | - | |
71 | 65 | When /^I erase the "([^"]*)" field$/ do |field_name| |
72 | 66 | find_field(field_name).set "" |
73 | 67 | end | ... | ... |
plugins/mezuro/features/repository.feature
... | ... | @@ -30,19 +30,48 @@ Feature: Repository |
30 | 30 | And I should see "Configuration" |
31 | 31 | And I should see "Add" button |
32 | 32 | |
33 | - @selenium | |
34 | 33 | Scenario: I want to add a repository with no name |
34 | + And I have a Mezuro configuration with the following data | |
35 | + | name | Sample Configuration| | |
36 | + | description | Sample Description | | |
37 | + | user | joaosilva | | |
35 | 38 | Given I follow "Add Repository" |
36 | - When I fill the fields with the following data | |
37 | - | repository_name | | | |
39 | + When I fill the fields with the new following data | |
40 | + | repository_name | | | |
38 | 41 | | repository_description | My Description | |
39 | 42 | | repository_license | ISC License (ISC) | |
40 | 43 | | repository_process_period | Not Periodically | |
41 | 44 | | repository_type | SUBVERSION | |
42 | 45 | | repository_address | https://qt-calculator.svn.sourceforge.net/svnroot/qt-calculator | |
43 | - | repository_configuration_id | 1 | | |
46 | + | repository_configuration_id | Sample Configuration | | |
44 | 47 | And I press "Add" |
45 | 48 | Then I should see "Please fill all fields marked with (*)." inside an alert |
46 | 49 | |
50 | + Scenario: I want to add a repository with no address | |
51 | + Given I follow "Add Repository" | |
52 | + When I fill the fields with the new following data | |
53 | + | repository_name | My Name | | |
54 | + | repository_description | My Description | | |
55 | + | repository_license | ISC License (ISC) | | |
56 | + | repository_process_period | Not Periodically | | |
57 | + | repository_type | SUBVERSION | | |
58 | + | repository_address | | | |
59 | + | repository_configuration_id | Sample Configuration | | |
60 | + And I press "Add" | |
61 | + Then I should see "Please fill all fields marked with (*)." inside an alert | |
62 | + | |
63 | + Scenario: I want to add a repository with a invalid address for git repository | |
64 | + Given I follow "Add Repository" | |
65 | + When I fill the fields with the new following data | |
66 | + | repository_name | My Name | | |
67 | + | repository_description | My Description | | |
68 | + | repository_license | ISC License (ISC) | | |
69 | + | repository_process_period | Not Periodically | | |
70 | + | repository_type | GIT | | |
71 | + | repository_address | https://invalid-address.any-extension | | |
72 | + | repository_configuration_id | Sample Configuration | | |
73 | + And I press "Add" | |
74 | + Then I should see "Address does not match type GIT chosen." inside an alert | |
75 | + | |
47 | 76 | #Scenario: I want to add a repository with valid attributes |
48 | 77 | ... | ... |