Commit bcb7ad1e26a7a04fa03bebb1f39101ca1ec90dc1
Committed by
Rafael Manzo
1 parent
eac2f143
Exists in
colab
and in
4 other branches
Acceptance tests for create repository
Pending test until know how to manipulate select tags Signed-off-by: Fellipe Souto <fllsouto@gmail.com>
Showing
2 changed files
with
42 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,34 @@ |
| 1 | +Feature: Repository Creation | |
| 2 | + In order to register my repositories | |
| 3 | + As a regular user | |
| 4 | + I should be able to create repositories | |
| 5 | + | |
| 6 | +@kalibro_restart | |
| 7 | +Scenario: should exist the repository create page | |
| 8 | + Given I am a regular user | |
| 9 | + And I am signed in | |
| 10 | + And I own a sample project | |
| 11 | + And I am at the Sample Project page | |
| 12 | + When I click the New Repository link | |
| 13 | + Then I should see "New Repository" | |
| 14 | + | |
| 15 | +@kalibro_restart | |
| 16 | +Scenario: Should not show the create repository link to a nom project owner | |
| 17 | + Given I am a regular user | |
| 18 | + And I am signed in | |
| 19 | + And I have a sample project | |
| 20 | + When I am at the Sample Project page | |
| 21 | + Then I should not see New Repository | |
| 22 | + | |
| 23 | +@kalibro_restart @wip | |
| 24 | +Scenario: repository creation | |
| 25 | + Given I am a regular user | |
| 26 | + And I am signed in | |
| 27 | + And I own a sample project | |
| 28 | + And I am at the New Repository page | |
| 29 | + And I fill the Name field with "Kalibro" | |
| 30 | + And I set the select type as "GIT" | |
| 31 | + And I fill the Address field with "https://github.com/mezuro/kalibro_entities.git" | |
| 32 | + And I set the select configuration_id as "1" | |
| 33 | + When I press the Create Repository button | |
| 34 | + Then I should see a the created repository | ... | ... |
features/step_definitions/repository_steps.rb
| ... | ... | @@ -27,6 +27,14 @@ Given(/^I wait up for a ready processing$/) do |
| 27 | 27 | end |
| 28 | 28 | end |
| 29 | 29 | |
| 30 | +Given(/^I am at the New Repository page$/) do | |
| 31 | + visit new_project_repository_path(@project.id) | |
| 32 | +end | |
| 33 | + | |
| 34 | +When(/^I set the select (.+) as "(.+)"$/) do |field, text| | |
| 35 | + find_by_id("repository_#{field}").select(text) | |
| 36 | +end | |
| 37 | + | |
| 30 | 38 | When(/^I visit the repository show page$/) do |
| 31 | 39 | visit project_repository_path(@project.id, @repository.id) |
| 32 | 40 | end | ... | ... |