Commit 079b265135f3ecfb5dc8919923369c4059fcd3f4

Authored by Rafael Manzo
1 parent d7f96bdf

Fixed combox selection step

features/repository/create.feature
@@ -11,9 +11,9 @@ Scenario: repository creation @@ -11,9 +11,9 @@ Scenario: repository creation
11 And I have a sample configuration with native metrics 11 And I have a sample configuration with native metrics
12 And I am at the New Repository page 12 And I am at the New Repository page
13 And I fill the Name field with "Kalibro" 13 And I fill the Name field with "Kalibro"
14 - And I set the select field Type as "GIT" 14 + And I set the select field "Type" as "GIT"
15 And I fill the Address field with "https://github.com/mezuro/kalibro_entities.git" 15 And I fill the Address field with "https://github.com/mezuro/kalibro_entities.git"
16 - And I set the select field Configuration as the sample configuration 16 + And I set the select field "repository_configuration_id" as "Java"
17 When I press the Save button 17 When I press the Save button
18 Then I should be in the Sample Project page 18 Then I should be in the Sample Project page
19 And I should not see There are no repositories yet! 19 And I should not see There are no repositories yet!
@@ -28,8 +28,8 @@ Scenario: repository creation blank validations @@ -28,8 +28,8 @@ Scenario: repository creation blank validations
28 And I own a sample project 28 And I own a sample project
29 And I have a sample configuration with native metrics 29 And I have a sample configuration with native metrics
30 And I am at the New Repository page 30 And I am at the New Repository page
31 - And I set the select field Type as "GIT"  
32 - And I set the select field Configuration as the sample configuration 31 + And I set the select field "Type" as "GIT"
  32 + And I set the select field "repository_configuration_id" as "Java"
33 When I press the Save button 33 When I press the Save button
34 Then I should see "Name can't be blank" 34 Then I should see "Name can't be blank"
35 And I should see "Address can't be blank" 35 And I should see "Address can't be blank"
@@ -43,8 +43,8 @@ Scenario: repository creation with name already taken @@ -43,8 +43,8 @@ Scenario: repository creation with name already taken
43 And I have a sample repository within the sample project named "KalibroEntities" 43 And I have a sample repository within the sample project named "KalibroEntities"
44 And I am at the New Repository page 44 And I am at the New Repository page
45 And I fill the Name field with "KalibroEntities" 45 And I fill the Name field with "KalibroEntities"
46 - And I set the select field Type as "GIT" 46 + And I set the select field "Type" as "GIT"
47 And I fill the Address field with "https://github.com/mezuro/kalibro_entities.git" 47 And I fill the Address field with "https://github.com/mezuro/kalibro_entities.git"
48 - And I set the select field Configuration as the sample configuration 48 + And I set the select field "repository_configuration_id" as "Java"
49 When I press the Save button 49 When I press the Save button
50 Then I should see "There's already" 50 Then I should see "There's already"
51 \ No newline at end of file 51 \ No newline at end of file
features/step_definitions/repository_steps.rb
@@ -35,12 +35,8 @@ Given(/^I am at the New Repository page$/) do @@ -35,12 +35,8 @@ Given(/^I am at the New Repository page$/) do
35 visit new_project_repository_path(@project.id) 35 visit new_project_repository_path(@project.id)
36 end 36 end
37 37
38 -When(/^I set the select field (.+) as "(.+)"$/) do |field, text|  
39 - find('option', text: text).click()  
40 -end  
41 -  
42 -When(/^I set the select field Configuration as the sample configuration$/) do  
43 - find('option', text: @configuration.name).click() 38 +When(/^I set the select field "(.+)" as "(.+)"$/) do |field, text|
  39 + select text, from: field
44 end 40 end
45 41
46 When(/^I visit the repository show page$/) do 42 When(/^I visit the repository show page$/) do