From 60dbdf9bc5bb61f9a949bf5b7015d04e14f426e7 Mon Sep 17 00:00:00 2001 From: Heitor Reis Date: Wed, 8 Jul 2015 11:10:46 -0300 Subject: [PATCH] Updated repository creation tests to incorporate the new validations --- .travis.yml | 2 +- features/repository/create.feature | 7 +++---- features/step_definitions/repository_steps.rb | 9 +++++++++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index f371b3f..7b4480c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ addons: postgresql: "9.3" before_script: - - git clone https://github.com/mezuro/kalibro_install.git -b v2.6 kalibro_install + - git clone https://github.com/mezuro/kalibro_install.git -b v2.7 kalibro_install - pushd kalibro_install # Remove bugged libzmq3 package, see https://github.com/travis-ci/travis-ci/issues/982 and https://github.com/travis-ci/travis-ci/issues/1715 for details - sudo apt-get remove libzmq3 diff --git a/features/repository/create.feature b/features/repository/create.feature index 47fb0aa..66a33e5 100644 --- a/features/repository/create.feature +++ b/features/repository/create.feature @@ -48,9 +48,8 @@ Scenario: repository creation blank validations Scenario: repository creation with name already taken Given I am a regular user And I am signed in - And I own a sample project And I have a sample configuration with native metrics - And I have a sample repository within the sample project named "KalibroEntities" + And I have a sample repository named "KalibroEntities" And I am at the New Repository page And I fill the Name field with "KalibroEntities" And I fill the Description field with "Description" @@ -60,7 +59,7 @@ Scenario: repository creation with name already taken And I set the select field "Process Period" as "1 day" And I set the select field "Configuration" as "Java" When I press the Save button - Then I should see "Name should be unique within project" + Then I should see "Name has already been taken" @kalibro_configuration_restart @kalibro_processor_restart @javascript Scenario: Repository name with whitespaces @@ -77,7 +76,7 @@ Scenario: Repository name with whitespaces And I set the select field "Process Period" as "1 day" And I set the select field "Configuration" as "Java" When I press the Save button - Then I should see "Name should be unique within project" + Then I should see "Name has already been taken" @kalibro_configuration_restart @kalibro_processor_restart @javascript Scenario: Create repository without project diff --git a/features/step_definitions/repository_steps.rb b/features/step_definitions/repository_steps.rb index 4695291..0065565 100644 --- a/features/step_definitions/repository_steps.rb +++ b/features/step_definitions/repository_steps.rb @@ -38,6 +38,15 @@ Given(/^I have a sample repository within the sample project named "(.+)"$/) do kalibro_configuration_id: @kalibro_configuration.id, id: nil, name: name}) end +Given(/^I have a sample repository named "(.+)"$/) do |name| + @repository = FactoryGirl.create(:repository, + project_id: nil, + kalibro_configuration_id: @kalibro_configuration.id, + id: nil, + name: name) +end + + Given(/^I have a sample of an invalid repository within the sample project$/) do @repository = FactoryGirl.create(:repository, {project_id: @project.id, kalibro_configuration_id: @kalibro_configuration.id, id: nil, address: "https://invalidrepository.git"}) -- libgit2 0.21.2