From bcb7ad1e26a7a04fa03bebb1f39101ca1ec90dc1 Mon Sep 17 00:00:00 2001 From: Guilherme Rojas V. de Lima Date: Tue, 22 Oct 2013 20:03:33 -0200 Subject: [PATCH] Acceptance tests for create repository --- features/repository/create.feature | 34 ++++++++++++++++++++++++++++++++++ features/step_definitions/repository_steps.rb | 8 ++++++++ 2 files changed, 42 insertions(+), 0 deletions(-) create mode 100644 features/repository/create.feature diff --git a/features/repository/create.feature b/features/repository/create.feature new file mode 100644 index 0000000..2bade73 --- /dev/null +++ b/features/repository/create.feature @@ -0,0 +1,34 @@ +Feature: Repository Creation + In order to register my repositories + As a regular user + I should be able to create repositories + +@kalibro_restart +Scenario: should exist the repository create page + Given I am a regular user + And I am signed in + And I own a sample project + And I am at the Sample Project page + When I click the New Repository link + Then I should see "New Repository" + +@kalibro_restart +Scenario: Should not show the create repository link to a nom project owner + Given I am a regular user + And I am signed in + And I have a sample project + When I am at the Sample Project page + Then I should not see New Repository + +@kalibro_restart @wip +Scenario: repository creation + Given I am a regular user + And I am signed in + And I own a sample project + And I am at the New Repository page + And I fill the Name field with "Kalibro" + And I set the select type as "GIT" + And I fill the Address field with "https://github.com/mezuro/kalibro_entities.git" + And I set the select configuration_id as "1" + When I press the Create Repository button + Then I should see a the created repository diff --git a/features/step_definitions/repository_steps.rb b/features/step_definitions/repository_steps.rb index a3132a1..62302ed 100644 --- a/features/step_definitions/repository_steps.rb +++ b/features/step_definitions/repository_steps.rb @@ -27,6 +27,14 @@ Given(/^I wait up for a ready processing$/) do end end +Given(/^I am at the New Repository page$/) do + visit new_project_repository_path(@project.id) +end + +When(/^I set the select (.+) as "(.+)"$/) do |field, text| + find_by_id("repository_#{field}").select(text) +end + When(/^I visit the repository show page$/) do visit project_repository_path(@project.id, @repository.id) end -- libgit2 0.21.2