Commit 60dbdf9bc5bb61f9a949bf5b7015d04e14f426e7

Authored by Heitor
1 parent c0c47443

Updated repository creation tests to incorporate the new validations

Now the repository name should be globally unique, instead of restricted
to the project scope

Also updated the travis script to use the new version of
kalibro_processor
@@ -5,7 +5,7 @@ addons: @@ -5,7 +5,7 @@ addons:
5 postgresql: "9.3" 5 postgresql: "9.3"
6 6
7 before_script: 7 before_script:
8 - - git clone https://github.com/mezuro/kalibro_install.git -b v2.6 kalibro_install 8 + - git clone https://github.com/mezuro/kalibro_install.git -b v2.7 kalibro_install
9 - pushd kalibro_install 9 - pushd kalibro_install
10 # 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 10 # 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
11 - sudo apt-get remove libzmq3 11 - sudo apt-get remove libzmq3
features/repository/create.feature
@@ -48,9 +48,8 @@ Scenario: repository creation blank validations @@ -48,9 +48,8 @@ Scenario: repository creation blank validations
48 Scenario: repository creation with name already taken 48 Scenario: repository creation with name already taken
49 Given I am a regular user 49 Given I am a regular user
50 And I am signed in 50 And I am signed in
51 - And I own a sample project  
52 And I have a sample configuration with native metrics 51 And I have a sample configuration with native metrics
53 - And I have a sample repository within the sample project named "KalibroEntities" 52 + And I have a sample repository named "KalibroEntities"
54 And I am at the New Repository page 53 And I am at the New Repository page
55 And I fill the Name field with "KalibroEntities" 54 And I fill the Name field with "KalibroEntities"
56 And I fill the Description field with "Description" 55 And I fill the Description field with "Description"
@@ -60,7 +59,7 @@ Scenario: repository creation with name already taken @@ -60,7 +59,7 @@ Scenario: repository creation with name already taken
60 And I set the select field "Process Period" as "1 day" 59 And I set the select field "Process Period" as "1 day"
61 And I set the select field "Configuration" as "Java" 60 And I set the select field "Configuration" as "Java"
62 When I press the Save button 61 When I press the Save button
63 - Then I should see "Name should be unique within project" 62 + Then I should see "Name has already been taken"
64 63
65 @kalibro_configuration_restart @kalibro_processor_restart @javascript 64 @kalibro_configuration_restart @kalibro_processor_restart @javascript
66 Scenario: Repository name with whitespaces 65 Scenario: Repository name with whitespaces
@@ -77,7 +76,7 @@ Scenario: Repository name with whitespaces @@ -77,7 +76,7 @@ Scenario: Repository name with whitespaces
77 And I set the select field "Process Period" as "1 day" 76 And I set the select field "Process Period" as "1 day"
78 And I set the select field "Configuration" as "Java" 77 And I set the select field "Configuration" as "Java"
79 When I press the Save button 78 When I press the Save button
80 - Then I should see "Name should be unique within project" 79 + Then I should see "Name has already been taken"
81 80
82 @kalibro_configuration_restart @kalibro_processor_restart @javascript 81 @kalibro_configuration_restart @kalibro_processor_restart @javascript
83 Scenario: Create repository without project 82 Scenario: Create repository without project
features/step_definitions/repository_steps.rb
@@ -38,6 +38,15 @@ Given(/^I have a sample repository within the sample project named "(.+)"$/) do @@ -38,6 +38,15 @@ Given(/^I have a sample repository within the sample project named "(.+)"$/) do
38 kalibro_configuration_id: @kalibro_configuration.id, id: nil, name: name}) 38 kalibro_configuration_id: @kalibro_configuration.id, id: nil, name: name})
39 end 39 end
40 40
  41 +Given(/^I have a sample repository named "(.+)"$/) do |name|
  42 + @repository = FactoryGirl.create(:repository,
  43 + project_id: nil,
  44 + kalibro_configuration_id: @kalibro_configuration.id,
  45 + id: nil,
  46 + name: name)
  47 +end
  48 +
  49 +
41 Given(/^I have a sample of an invalid repository within the sample project$/) do 50 Given(/^I have a sample of an invalid repository within the sample project$/) do
42 @repository = FactoryGirl.create(:repository, {project_id: @project.id, 51 @repository = FactoryGirl.create(:repository, {project_id: @project.id,
43 kalibro_configuration_id: @kalibro_configuration.id, id: nil, address: "https://invalidrepository.git"}) 52 kalibro_configuration_id: @kalibro_configuration.id, id: nil, address: "https://invalidrepository.git"})