From c5da7ea3887e8dac86fb0ab5a2ac16433b140b29 Mon Sep 17 00:00:00 2001 From: Guilherme Rojas V. de Lima Date: Wed, 23 Oct 2013 14:01:30 -0200 Subject: [PATCH] Fixed step for select tag. --- features/repository/create.feature | 7 ++++--- features/step_definitions/repository_steps.rb | 8 ++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/features/repository/create.feature b/features/repository/create.feature index 2bade73..6d873bd 100644 --- a/features/repository/create.feature +++ b/features/repository/create.feature @@ -20,15 +20,16 @@ Scenario: Should not show the create repository link to a nom project owner When I am at the Sample Project page Then I should not see New Repository -@kalibro_restart @wip +@kalibro_restart Scenario: repository creation Given I am a regular user And I am signed in And I own a sample project + And I have a sample configuration with native metrics 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 set the select field 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" + And I set the select field Configuration as the sample configuration 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 62302ed..5779d31 100644 --- a/features/step_definitions/repository_steps.rb +++ b/features/step_definitions/repository_steps.rb @@ -31,8 +31,12 @@ 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) +When(/^I set the select field (.+) as "(.+)"$/) do |field, text| + find('option', text: text).click() +end + +When(/^I set the select field Configuration as the sample configuration$/) do + find('option', text: @configuration.name).click() end When(/^I visit the repository show page$/) do -- libgit2 0.21.2