Commit 74253f01 authored by blackst0ne's avatar blackst0ne

Replace 'starred_projects.feature' spinach test with an rspec analog

parent e5226177
---
title: Replace 'starred_projects.feature' spinach test with an rspec analog
merge_request: 11752
author: blackst0ne
@dashboard
Feature: Dashboard Starred Projects
Background:
Given I sign in as a user
And public project "Community"
And I starred project "Community"
And I own project "Shop"
And I visit dashboard starred projects page
Scenario: I should see projects list
Then I should see project "Community"
And I should not see project "Shop"
...@@ -3,10 +3,11 @@ require 'spec_helper' ...@@ -3,10 +3,11 @@ require 'spec_helper'
RSpec.describe 'Dashboard Projects', feature: true do RSpec.describe 'Dashboard Projects', feature: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, name: "awesome stuff") } let(:project) { create(:project, name: "awesome stuff") }
let(:project2) { create(:project, :public, name: 'Community project') }
before do before do
project.team << [user, :developer] project.team << [user, :developer]
login_as user login_as(user)
end end
it 'shows the project the user in a member of in the list' do it 'shows the project the user in a member of in the list' do
...@@ -14,6 +15,17 @@ RSpec.describe 'Dashboard Projects', feature: true do ...@@ -14,6 +15,17 @@ RSpec.describe 'Dashboard Projects', feature: true do
expect(page).to have_content('awesome stuff') expect(page).to have_content('awesome stuff')
end end
context 'when on Starred projects tab' do
it 'shows only starred projects' do
user.toggle_star(project2)
visit(starred_dashboard_projects_path)
expect(page).not_to have_content(project.name)
expect(page).to have_content(project2.name)
end
end
describe "with a pipeline", redis: true do describe "with a pipeline", redis: true do
let!(:pipeline) { create(:ci_pipeline, project: project, sha: project.commit.sha) } let!(:pipeline) { create(:ci_pipeline, project: project, sha: project.commit.sha) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment