Test showing pipelines on the dashboard

This commit is contained in:
Bob Van Landuyt 2017-03-13 13:24:06 +01:00
parent 9ce549b22a
commit 56f6c6ac16
2 changed files with 28 additions and 2 deletions

View file

@ -0,0 +1,4 @@
---
title: Speed up project dashboard by caching pipeline status and eager loading routes
merge_request: 9903
author:

View file

@ -1,10 +1,32 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe 'Dashboard Projects', feature: true do RSpec.describe 'Dashboard Projects', feature: true do
let(:user) { create(:user) }
let(:project) { create(:project, name: "awesome stuff") }
before do before do
login_as(create :user) project.team << [user, :developer]
login_as user
visit dashboard_projects_path visit dashboard_projects_path
end end
it 'shows the project the user in a member of in the list' do
visit dashboard_projects_path
expect(page).to have_content('awesome stuff')
end
describe "with a pipeline" do
let(:pipeline) { create(:ci_pipeline, :success, project: project, sha: project.commit.sha) }
before do
pipeline
end
it 'shows that the last pipeline passed' do
visit dashboard_projects_path
expect(page).to have_xpath("//a[@href='#{pipelines_namespace_project_commit_path(project.namespace, project, project.commit)}']")
end
end
it_behaves_like "an autodiscoverable RSS feed with current_user's private token" it_behaves_like "an autodiscoverable RSS feed with current_user's private token"
end end