Commit 657dff5ca3c354a62ff99600c0bf382705fa9577

Authored by Rafael Reggiani Manzo
1 parent 8b3bce0a
Exists in colab and in 2 other branches master, stable

Fix homepage cache acceptance test

It was still relying on repositories with no attributes while
Repository#latest now relies on attributes to list just the public ones.
features/homepage.feature
@@ -7,7 +7,7 @@ Feature: Homepage @@ -7,7 +7,7 @@ Feature: Homepage
7 Scenario: Before signing in 7 Scenario: Before signing in
8 Given I have a project named "GCC" 8 Given I have a project named "GCC"
9 And there is a public configuration created named "Test Configuration" 9 And there is a public configuration created named "Test Configuration"
10 - And I have a sample repository named "Test Repository" 10 + And I have a public repository named "Test Repository"
11 Then I am at the homepage 11 Then I am at the homepage
12 And I should see "Home" 12 And I should see "Home"
13 And I should see "Projects" 13 And I should see "Projects"
features/step_definitions/repository_steps.rb
@@ -135,6 +135,15 @@ Given(/^I have a sample configuration with the (\w+) native metric$/) do |metric @@ -135,6 +135,15 @@ Given(/^I have a sample configuration with the (\w+) native metric$/) do |metric
135 kalibro_configuration_id: @kalibro_configuration.id}) 135 kalibro_configuration_id: @kalibro_configuration.id})
136 end 136 end
137 137
  138 +Given(/^I have a public repository named "(.*?)"$/) do |name|
  139 + @repository = FactoryGirl.create(:repository,
  140 + project_id: nil,
  141 + kalibro_configuration_id: @kalibro_configuration.id,
  142 + id: nil,
  143 + name: name)
  144 + FactoryGirl.create(:repository_attributes, {repository_id: @repository.id})
  145 +end
  146 +
138 When(/^I click on the sample metric's name$/) do 147 When(/^I click on the sample metric's name$/) do
139 find_link(@metric_results.first.metric_configuration.metric.name).trigger('click') 148 find_link(@metric_results.first.metric_configuration.metric.name).trigger('click')
140 end 149 end