From 2227335ca7cbcbc1defa4653f3724848249ed5e4 Mon Sep 17 00:00:00 2001 From: Diego Araújo Date: Thu, 4 Oct 2012 17:58:08 -0300 Subject: [PATCH] [Mezuro] Updating acceptance tests --- features/step_definitions/mezuro_steps.rb | 15 +++++++++++++++ plugins/mezuro/test/features/creating_configuration.feature | 26 +++++++++++++------------- plugins/mezuro/test/features/creating_project.feature | 33 ++++++++++++++++----------------- 3 files changed, 44 insertions(+), 30 deletions(-) diff --git a/features/step_definitions/mezuro_steps.rb b/features/step_definitions/mezuro_steps.rb index 3af1b89..88492d3 100644 --- a/features/step_definitions/mezuro_steps.rb +++ b/features/step_definitions/mezuro_steps.rb @@ -1,3 +1,18 @@ +When /^I create a Mezuro (project|configuration) with the following data$/ do |type, fields| + click_link ("Mezuro " + type) + + fields.rows_hash.each do |name, value| + When %{I fill in "#{name}" with "#{value}"} + end + + if Article.find_by_name(fields.rows_hash[:Title]) + return false + end + + click_button "Save" # Does not work without selenium? + Article.find_by_name(fields.rows_hash[:Title]) +end + Then /^I directly delete content with name "([^\"]*)" for testing purposes$/ do |content_name| Article.find_by_name(content_name).destroy end diff --git a/plugins/mezuro/test/features/creating_configuration.feature b/plugins/mezuro/test/features/creating_configuration.feature index 9146de0..3909cf9 100644 --- a/plugins/mezuro/test/features/creating_configuration.feature +++ b/plugins/mezuro/test/features/creating_configuration.feature @@ -1,6 +1,6 @@ Feature: Create configuration As a mezuro user - I want to create a Kalibro configuration + I want to create a Mezuro configuration Background: Given the following users @@ -8,14 +8,14 @@ Feature: Create configuration | joaosilva | Joao Silva | And I am logged in as "joaosilva" And "Mezuro" plugin is enabled - And the following community - | identifier | name | - | mycommunity | My Community | - And "Joao Silva" is admin of "My Community" + + Scenario: I see Mezuro Configuration on my control panel + When I go to the Control panel + Then I should see "Mezuro configuration" Scenario: creating with valid attributes - Given I am on My Community's cms - When I create a content of type "Kalibro configuration" with the following data + When I go to the Control panel + And I create a Mezuro configuration with the following data | Title | Qt_Calculator | | Description | A sample description | Then I should see "Name" @@ -24,17 +24,17 @@ Feature: Create configuration And I should see "A sample description" Scenario: creating with duplicated name - Given I am on My Community's cms - And I create a content of type "Kalibro configuration" with the following data + When I go to the Control panel + And I create a Mezuro configuration with the following data | Title | Original Title | - And I am on My Community's cms - When I create a content of type "Kalibro configuration" with the following data + And I go to the Control panel + And I create a Mezuro configuration with the following data | Title | Original Title | Then I should see "1 error prohibited this article from being saved" Scenario: creating without title - Given I am on My Community's cms - When I create a content of type "Kalibro configuration" with the following data + When I go to the Control panel + And I create a Mezuro configuration with the following data | Title | | Then I should see "1 error prohibited this article from being saved" diff --git a/plugins/mezuro/test/features/creating_project.feature b/plugins/mezuro/test/features/creating_project.feature index ad28b91..22fe9ff 100644 --- a/plugins/mezuro/test/features/creating_project.feature +++ b/plugins/mezuro/test/features/creating_project.feature @@ -1,6 +1,6 @@ Feature: Create project As a mezuro user - I want to create a Kalibro project + I want to create a Mezuro project Background: Given the following users @@ -13,10 +13,9 @@ Feature: Create project | mycommunity | My Community | And "Joao Silva" is admin of "My Community" - Scenario: I see Kalibro project's input form - Given I am on My Community's cms - When I follow "New content" - And I follow "Kalibro project" + Scenario: I see Mezuro project's input form + Given I am on My Community's control panel + When I follow "Mezuro Project" Then I should see "Title" And I should see "License" And I should see "Repository type" @@ -28,24 +27,24 @@ Feature: Create project And I should see "Configuration" And I should see "Kalibro for Java" - Scenario: I create a Kalibro project with valid attributes - Given I am on My Community's cms - When I create a content of type "Kalibro project" with the following data + Scenario: I create a Mezuro project with valid attributes + Given I am on My Community's control panel + When I create a Mezuro project with the following data | Title | Sample Project | | License | GPL | | Repository type | SUBVERSION | | Repository url | https://qt-calculator.svn.sourceforge.net/svnroot/qt-calculator | | Configuration | Kalibro for Java | - Then I should see "Sample Project" - And I should see "GPL" - And I should see "SUBVERSION" - And I should see "https://qt-calculator.svn.sourceforge.net/svnroot/qt-calculator" - And I should see "Kalibro for Java" - And I directly delete content with name "Sample Project" for testing purposes + Then I should see "Sample Project" + And I should see "GPL" + And I should see "SUBVERSION" + And I should see "https://qt-calculator.svn.sourceforge.net/svnroot/qt-calculator" + And I should see "Kalibro for Java" + And I directly delete content with name "Sample Project" for testing purposes - Scenario: I can't create a Kalibro project with invalid attributes - Given I am on My Community's cms - When I create a content of type "Kalibro project" with the following data + Scenario: I can't create a Mezuro project with invalid attributes + Given I am on My Community's control panel + When I create a Mezuro project with the following data | Title | | | License | GPL | | Repository type | SUBVERSION | -- libgit2 0.21.2