From 19edc2321b4b87a70fd05c7b5016253646ed3568 Mon Sep 17 00:00:00 2001 From: Heitor Reis Date: Mon, 2 Feb 2015 16:02:05 -0200 Subject: [PATCH] Fixing repository creation acceptance tests --- Gemfile.lock | 2 +- app/models/repository.rb | 2 ++ app/views/repositories/_form.html.erb | 12 ++++++------ app/views/repositories/show.html.erb | 2 +- features/repository/create.feature | 8 ++++---- features/step_definitions/repository_steps.rb | 4 ++-- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 52630e4..767bb9c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/mezuro/kalibro_client - revision: 6288c9bb83557f3ced7cc3cb20bc857c1a6166af + revision: 9688add754613bd497ec3e94d0cd568a3e5d4f2c specs: kalibro_client (0.0.1) activesupport (>= 2.2.1) diff --git a/app/models/repository.rb b/app/models/repository.rb index 71739a3..4da9666 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -1,4 +1,6 @@ class Repository < KalibroClient::Entities::Processor::Repository + include KalibroRecord + def last_processing_of if has_processing last_processing diff --git a/app/views/repositories/_form.html.erb b/app/views/repositories/_form.html.erb index 8eb9717..fc566de 100644 --- a/app/views/repositories/_form.html.erb +++ b/app/views/repositories/_form.html.erb @@ -42,7 +42,7 @@
- <%= f.label :scm_type, class: 'control-label' %> + <%= f.label :scm_type, 'Type', class: 'control-label' %> <%= f.select( :scm_type, @repository_types, class: 'tooltip-control' ) %>
@@ -66,8 +66,8 @@
- <%= f.label :process_period, 'Process Period', class: 'control-label' %> - <%= f.select( :process_period, periodicity_options, class: 'tooltip-control' ) %> + <%= f.label :period, 'Process Period', class: 'control-label' %> + <%= f.select( :period, periodicity_options, class: 'tooltip-control' ) %>

@@ -78,9 +78,9 @@

- <%= f.label :configuration, class: 'control-label' %> - <% configuration_list = KalibroGatekeeperClient::Entities::Configuration.all.map { |conf| [conf.name, conf.id] } %> - <%= f.select( :configuration_id, configuration_list, class: 'tooltip-control' ) %> + <%= f.label :configuration, 'Configuration', class: 'control-label' %> + <% configuration_list = KalibroClient::Entities::Configurations::KalibroConfiguration.all.map { |conf| [conf.name, conf.id] } %> + <%= f.select( :kalibro_configuration_id, configuration_list, class: 'tooltip-control' ) %>

diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index f752425..1ac85cb 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -24,7 +24,7 @@

Periodicity: - <%= periodicity_option(@repository.process_period) %> + <%= periodicity_option(@repository.period) %>

diff --git a/features/repository/create.feature b/features/repository/create.feature index 3227537..3fbe19d 100644 --- a/features/repository/create.feature +++ b/features/repository/create.feature @@ -16,7 +16,7 @@ Scenario: repository creation And I set the select field "Type" as "GIT" And I fill the Address field with "https://github.com/mezuro/kalibro_gem.git" And I set the select field "Process Period" as "1 day" - And I set the select field "repository_configuration_id" as "Java" + And I set the select field "repository_kalibro_configuration_id" as "Java" When I press the Save button Then I should see the saved repository's content @@ -32,7 +32,7 @@ Scenario: repository creation blank validations And I set the select field "License" as "ISC License (ISC)" And I set the select field "Type" as "GIT" And I set the select field "Process Period" as "1 day" - And I set the select field "repository_configuration_id" as "Java" + And I set the select field "repository_kalibro_configuration_id" as "Java" When I press the Save button Then I should see "Name can't be blank" And I should see "Address can't be blank" @@ -51,6 +51,6 @@ Scenario: repository creation with name already taken And I set the select field "Type" as "GIT" And I fill the Address field with "https://github.com/mezuro/kalibro_gem.git" And I set the select field "Process Period" as "1 day" - And I set the select field "repository_configuration_id" as "Java" + And I set the select field "repository_kalibro_configuration_id" as "Java" When I press the Save button - Then I should see "Name There is already a Repository with name KalibroEntities! Please, choose another one." \ No newline at end of file + Then I should see "Name should be unique within project" diff --git a/features/step_definitions/repository_steps.rb b/features/step_definitions/repository_steps.rb index 79bab51..6d0229f 100644 --- a/features/step_definitions/repository_steps.rb +++ b/features/step_definitions/repository_steps.rb @@ -136,7 +136,7 @@ Then(/^I should see a sample child's name$/) do end Then(/^I should see the given repository's content$/) do - expect(page).to have_content(@repository.type) + expect(page).to have_content(@repository.scm_type) expect(page).to have_content(@repository.description) expect(page).to have_content(@repository.name) expect(page).to have_content(@repository.license) @@ -165,7 +165,7 @@ end Then(/^I should see the saved repository's content$/) do @repository = Repository.all.last # suposing the last repository created is the only created too. - expect(page).to have_content(@repository.type) + expect(page).to have_content(@repository.scm_type) expect(page).to have_content(@repository.description) expect(page).to have_content(@repository.name) expect(page).to have_content(@repository.license) -- libgit2 0.21.2