Commit c5da7ea3887e8dac86fb0ab5a2ac16433b140b29

Authored by Guilherme Rojas V. de Lima
Committed by Rafael Manzo
1 parent bcb7ad1e

Fixed step for select tag.

Signed-off-by: Renan Fichberg <rfichberg@gmail.com>
features/repository/create.feature
... ... @@ -20,15 +20,16 @@ Scenario: Should not show the create repository link to a nom project owner
20 20 When I am at the Sample Project page
21 21 Then I should not see New Repository
22 22  
23   -@kalibro_restart @wip
  23 +@kalibro_restart
24 24 Scenario: repository creation
25 25 Given I am a regular user
26 26 And I am signed in
27 27 And I own a sample project
  28 + And I have a sample configuration with native metrics
28 29 And I am at the New Repository page
29 30 And I fill the Name field with "Kalibro"
30   - And I set the select type as "GIT"
  31 + And I set the select field Type as "GIT"
31 32 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 + And I set the select field Configuration as the sample configuration
33 34 When I press the Create Repository button
34 35 Then I should see a the created repository
... ...
features/step_definitions/repository_steps.rb
... ... @@ -31,8 +31,12 @@ Given(/^I am at the New Repository page$/) do
31 31 visit new_project_repository_path(@project.id)
32 32 end
33 33  
34   -When(/^I set the select (.+) as "(.+)"$/) do |field, text|
35   - find_by_id("repository_#{field}").select(text)
  34 +When(/^I set the select field (.+) as "(.+)"$/) do |field, text|
  35 + find('option', text: text).click()
  36 +end
  37 +
  38 +When(/^I set the select field Configuration as the sample configuration$/) do
  39 + find('option', text: @configuration.name).click()
36 40 end
37 41  
38 42 When(/^I visit the repository show page$/) do
... ...