Commit 3d5f34bfe2f8db12f6446f6f239a1906e5f32d8f
Committed by
Rafael Manzo
1 parent
69b7ccd7
Exists in
colab
and in
4 other branches
Created features for independent repositories listing
There should be a repository link at the home page. It should take the user to the page with all the repositories. A project should not list independent repositories. Signed off by: Rafael Reggiani Manzo <rr.manzo@gmail.com>
Showing
3 changed files
with
68 additions
and
0 deletions
Show diff stats
features/project/show.feature
| @@ -24,6 +24,15 @@ Scenario: Should show the create repository link the project owner | @@ -24,6 +24,15 @@ Scenario: Should show the create repository link the project owner | ||
| 24 | When I am at the Sample Project page | 24 | When I am at the Sample Project page |
| 25 | Then I should see "New Repository" | 25 | Then I should see "New Repository" |
| 26 | 26 | ||
| 27 | +@kalibro_processor_restart | ||
| 28 | +Scenario: Should not show the independent repositories for a project | ||
| 29 | + Given I am a regular user | ||
| 30 | + And I am signed in | ||
| 31 | + And I own a sample project | ||
| 32 | + And I have sample project_attributes | ||
| 33 | + And I have a sample repository | ||
| 34 | + When I am at the Sample Project page | ||
| 35 | + Then I should see "There are no Repositories yet!" | ||
| 27 | 36 | ||
| 28 | @kalibro_processor_restart | 37 | @kalibro_processor_restart |
| 29 | Scenario: Considering the project has no repositories | 38 | Scenario: Considering the project has no repositories |
| @@ -0,0 +1,36 @@ | @@ -0,0 +1,36 @@ | ||
| 1 | +Feature: Repository listing | ||
| 2 | + In order to interact with other repositories | ||
| 3 | + As a regular user | ||
| 4 | + I should have various listings | ||
| 5 | + | ||
| 6 | + @wip | ||
| 7 | + Scenario: Listing repositories | ||
| 8 | + Given I am at the homepage | ||
| 9 | + When I click the Repository link | ||
| 10 | + Then I should see "Repositories" | ||
| 11 | + And I should see "Name" | ||
| 12 | + And I should see "Description" | ||
| 13 | + And I should see "You must be logged in to create Repositories" | ||
| 14 | + | ||
| 15 | + @kalibro_processor_restart @kalibro_configuration_restart @wip | ||
| 16 | + Scenario: Should list the existing repositories | ||
| 17 | + Given I am a regular user | ||
| 18 | + And I am signed in | ||
| 19 | + And I have a sample repository | ||
| 20 | + And I have a sample project | ||
| 21 | + And I have a sample configuration | ||
| 22 | + And I have a sample repository within the sample project | ||
| 23 | + And I am at the All Repositories page | ||
| 24 | + Then the sample repository should be there | ||
| 25 | + And the project repository should be there | ||
| 26 | + And I should not see "You must be logged in to create new Repositories." | ||
| 27 | + | ||
| 28 | + @kalibro_processor_restart @wip | ||
| 29 | + Scenario: Should show the existing repository | ||
| 30 | + Given I am a regular user | ||
| 31 | + And I am signed in | ||
| 32 | + And I have a sample repository | ||
| 33 | + And I own that independent repository | ||
| 34 | + And I am at the All Repositories page | ||
| 35 | + When I click the Show link | ||
| 36 | + Then the sample repository should be there |
features/step_definitions/repository_steps.rb
| @@ -93,6 +93,18 @@ Given(/^I own that repository$/) do | @@ -93,6 +93,18 @@ Given(/^I own that repository$/) do | ||
| 93 | FactoryGirl.create(:repository_attributes, {repository_id: @repository.id, user_id: @user.id}) | 93 | FactoryGirl.create(:repository_attributes, {repository_id: @repository.id, user_id: @user.id}) |
| 94 | end | 94 | end |
| 95 | 95 | ||
| 96 | +Given(/^I own that independent repository$/) do | ||
| 97 | + FactoryGirl.create(:repository_attributes, {repository_id: @independent_repository.id, user_id: @user.id}) | ||
| 98 | +end | ||
| 99 | + | ||
| 100 | +Given(/^I have a sample repository$/) do | ||
| 101 | + @independent_repository = FactoryGirl.create(:ruby_repository) | ||
| 102 | +end | ||
| 103 | + | ||
| 104 | +Given(/^I am at the All Repositories page$/) do | ||
| 105 | + visit repositories_path | ||
| 106 | +end | ||
| 107 | + | ||
| 96 | When(/^I click on the sample metric's name$/) do | 108 | When(/^I click on the sample metric's name$/) do |
| 97 | find_link(@metric_results.first.metric_configuration.metric.name).trigger('click') | 109 | find_link(@metric_results.first.metric_configuration.metric.name).trigger('click') |
| 98 | end | 110 | end |
| @@ -179,3 +191,14 @@ Then(/^"(.*?)" should be lesser than "(.*?)"$/) do |arg1, arg2| | @@ -179,3 +191,14 @@ Then(/^"(.*?)" should be lesser than "(.*?)"$/) do |arg1, arg2| | ||
| 179 | v2 = eval "@#{arg2}" | 191 | v2 = eval "@#{arg2}" |
| 180 | expect(v1 < v2).to be_truthy | 192 | expect(v1 < v2).to be_truthy |
| 181 | end | 193 | end |
| 194 | + | ||
| 195 | +Then(/^the sample repository should be there$/) do | ||
| 196 | + expect(page).to have_content(@independent_repository.name) | ||
| 197 | + expect(page).to have_content(@independent_repository.description) | ||
| 198 | +end | ||
| 199 | + | ||
| 200 | +Then(/^the project repository should be there$/) do | ||
| 201 | + expect(page).to have_content(@repository.name) | ||
| 202 | + expect(page).to have_content(@repository.description) | ||
| 203 | +end | ||
| 204 | + |