From 3d5f34bfe2f8db12f6446f6f239a1906e5f32d8f Mon Sep 17 00:00:00 2001 From: Diego Araújo Date: Mon, 6 Jul 2015 15:54:53 -0300 Subject: [PATCH] Created features for independent repositories listing --- features/project/show.feature | 9 +++++++++ features/repository/index.feature | 36 ++++++++++++++++++++++++++++++++++++ features/step_definitions/repository_steps.rb | 23 +++++++++++++++++++++++ 3 files changed, 68 insertions(+), 0 deletions(-) create mode 100644 features/repository/index.feature diff --git a/features/project/show.feature b/features/project/show.feature index 50ac6a2..a3e58fd 100644 --- a/features/project/show.feature +++ b/features/project/show.feature @@ -24,6 +24,15 @@ Scenario: Should show the create repository link the project owner When I am at the Sample Project page Then I should see "New Repository" +@kalibro_processor_restart +Scenario: Should not show the independent repositories for a project + Given I am a regular user + And I am signed in + And I own a sample project + And I have sample project_attributes + And I have a sample repository + When I am at the Sample Project page + Then I should see "There are no Repositories yet!" @kalibro_processor_restart Scenario: Considering the project has no repositories diff --git a/features/repository/index.feature b/features/repository/index.feature new file mode 100644 index 0000000..a52ea2a --- /dev/null +++ b/features/repository/index.feature @@ -0,0 +1,36 @@ +Feature: Repository listing + In order to interact with other repositories + As a regular user + I should have various listings + + @wip + Scenario: Listing repositories + Given I am at the homepage + When I click the Repository link + Then I should see "Repositories" + And I should see "Name" + And I should see "Description" + And I should see "You must be logged in to create Repositories" + + @kalibro_processor_restart @kalibro_configuration_restart @wip + Scenario: Should list the existing repositories + Given I am a regular user + And I am signed in + And I have a sample repository + And I have a sample project + And I have a sample configuration + And I have a sample repository within the sample project + And I am at the All Repositories page + Then the sample repository should be there + And the project repository should be there + And I should not see "You must be logged in to create new Repositories." + + @kalibro_processor_restart @wip + Scenario: Should show the existing repository + Given I am a regular user + And I am signed in + And I have a sample repository + And I own that independent repository + And I am at the All Repositories page + When I click the Show link + Then the sample repository should be there diff --git a/features/step_definitions/repository_steps.rb b/features/step_definitions/repository_steps.rb index 5e8f830..73e193f 100644 --- a/features/step_definitions/repository_steps.rb +++ b/features/step_definitions/repository_steps.rb @@ -93,6 +93,18 @@ Given(/^I own that repository$/) do FactoryGirl.create(:repository_attributes, {repository_id: @repository.id, user_id: @user.id}) end +Given(/^I own that independent repository$/) do + FactoryGirl.create(:repository_attributes, {repository_id: @independent_repository.id, user_id: @user.id}) +end + +Given(/^I have a sample repository$/) do + @independent_repository = FactoryGirl.create(:ruby_repository) +end + +Given(/^I am at the All Repositories page$/) do + visit repositories_path +end + When(/^I click on the sample metric's name$/) do find_link(@metric_results.first.metric_configuration.metric.name).trigger('click') end @@ -179,3 +191,14 @@ Then(/^"(.*?)" should be lesser than "(.*?)"$/) do |arg1, arg2| v2 = eval "@#{arg2}" expect(v1 < v2).to be_truthy end + +Then(/^the sample repository should be there$/) do + expect(page).to have_content(@independent_repository.name) + expect(page).to have_content(@independent_repository.description) +end + +Then(/^the project repository should be there$/) do + expect(page).to have_content(@repository.name) + expect(page).to have_content(@repository.description) +end + -- libgit2 0.21.2