From 94993587d15ba49f2a5ddbab51b3d632fdc14c0b Mon Sep 17 00:00:00 2001 From: Daniel Alves + Diego Araújo + Guilherme Rojas Date: Thu, 21 Feb 2013 17:48:59 -0300 Subject: [PATCH] [Mezuro] More acceptance tests on repository.feature. Still working on it. --- features/step_definitions/mezuro_steps.rb | 16 +++++----------- plugins/mezuro/features/repository.feature | 37 +++++++++++++++++++++++++++++++++---- 2 files changed, 38 insertions(+), 15 deletions(-) diff --git a/features/step_definitions/mezuro_steps.rb b/features/step_definitions/mezuro_steps.rb index 7a3cdb6..f4e75ad 100644 --- a/features/step_definitions/mezuro_steps.rb +++ b/features/step_definitions/mezuro_steps.rb @@ -43,7 +43,7 @@ Then /^I should not see "([^"]*)" button$/ do |button_name| find_button(button_name).should be_nil end -When /^I have a Mezuro (project|reading group) with the following data$/ do |type,fields| +When /^I have a Mezuro (project|reading group|configuration) with the following data$/ do |type,fields| item = {} fields.rows_hash.each do |name, value| if(name=="user" or name=="community") @@ -52,22 +52,16 @@ When /^I have a Mezuro (project|reading group) with the following data$/ do |typ item.merge!(name => value) end end - if(type=="project") + if (type == "project") result = MezuroPlugin::ProjectContent.new(item) - elsif(type=="reading group") + elsif (type == "reading group") result = MezuroPlugin::ReadingGroupContent.new(item) + elsif (type == "configuration") + result = MezuroPlugin::ConfigurationContent.new(item) end result.save! end -When /^I have a configuration with the following data$/ do |fields| - attributes = {} - fields.rows_hash.each do |name, value| - attributes.merge!(name => value) - end - Kalibro::Configuration.create(attributes) -end - When /^I erase the "([^"]*)" field$/ do |field_name| find_field(field_name).set "" end diff --git a/plugins/mezuro/features/repository.feature b/plugins/mezuro/features/repository.feature index 16458d7..b7869bd 100644 --- a/plugins/mezuro/features/repository.feature +++ b/plugins/mezuro/features/repository.feature @@ -30,19 +30,48 @@ Feature: Repository And I should see "Configuration" And I should see "Add" button - @selenium Scenario: I want to add a repository with no name + And I have a Mezuro configuration with the following data + | name | Sample Configuration| + | description | Sample Description | + | user | joaosilva | Given I follow "Add Repository" - When I fill the fields with the following data - | repository_name | | + When I fill the fields with the new following data + | repository_name | | | repository_description | My Description | | repository_license | ISC License (ISC) | | repository_process_period | Not Periodically | | repository_type | SUBVERSION | | repository_address | https://qt-calculator.svn.sourceforge.net/svnroot/qt-calculator | - | repository_configuration_id | 1 | + | repository_configuration_id | Sample Configuration | And I press "Add" Then I should see "Please fill all fields marked with (*)." inside an alert + Scenario: I want to add a repository with no address + Given I follow "Add Repository" + When I fill the fields with the new following data + | repository_name | My Name | + | repository_description | My Description | + | repository_license | ISC License (ISC) | + | repository_process_period | Not Periodically | + | repository_type | SUBVERSION | + | repository_address | | + | repository_configuration_id | Sample Configuration | + And I press "Add" + Then I should see "Please fill all fields marked with (*)." inside an alert + + Scenario: I want to add a repository with a invalid address for git repository + Given I follow "Add Repository" + When I fill the fields with the new following data + | repository_name | My Name | + | repository_description | My Description | + | repository_license | ISC License (ISC) | + | repository_process_period | Not Periodically | + | repository_type | GIT | + | repository_address | https://invalid-address.any-extension | + | repository_configuration_id | Sample Configuration | + And I press "Add" + Then I should see "Address does not match type GIT chosen." inside an alert + #Scenario: I want to add a repository with valid attributes -- libgit2 0.21.2