Commit 19fd5920 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch '28402-fix-starred-projects-filter-wrong-message-on-no-results' into 'master'

Fix wrong message on starred projects filtering

Closes #28402

See merge request !9488
parents 71d371cf 71eeb863
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
- if @last_push - if @last_push
= render "events/event_last_push", event: @last_push = render "events/event_last_push", event: @last_push
- if @projects.any? - if @projects.any? || params[:filter_projects]
= render 'projects' = render 'projects'
- else - else
%h3 You don't have starred projects yet %h3 You don't have starred projects yet
......
---
title: Fix wrong message on starred projects filtering
merge_request:
author: George Andrinopoulos
require 'spec_helper' require 'spec_helper'
describe "Dashboard > User filters projects", feature: true do describe 'Dashboard > User filters projects', :feature do
describe 'filtering personal projects' do let(:user) { create(:user) }
let(:project) { create(:project, name: 'Victorialand', namespace: user.namespace) }
let(:user2) { create(:user) }
let(:project2) { create(:project, name: 'Treasure', namespace: user2.namespace) }
before do before do
user = create(:user)
project = create(:project, name: "Victorialand", namespace: user.namespace)
project.team << [user, :master] project.team << [user, :master]
user2 = create(:user) login_as(user)
project2 = create(:project, name: "Treasure", namespace: user2.namespace) end
describe 'filtering personal projects' do
before do
project2.team << [user, :developer] project2.team << [user, :developer]
login_as(user)
visit dashboard_projects_path visit dashboard_projects_path
end end
it 'filters by projects "Owned by me"' do it 'filters by projects "Owned by me"' do
click_link "Owned by me" click_link 'Owned by me'
expect(page).to have_css('.is-active', text: 'Owned by me') expect(page).to have_css('.is-active', text: 'Owned by me')
expect(page).to have_content('Victorialand') expect(page).to have_content('Victorialand')
expect(page).not_to have_content('Treasure') expect(page).not_to have_content('Treasure')
end end
end end
describe 'filtering starred projects', :js do
before do
user.toggle_star(project)
visit dashboard_projects_path
end
it 'returns message when starred projects fitler returns no results' do
fill_in 'project-filter-form-field', with: 'Beta\n'
expect(page).to have_content('No projects found')
expect(page).not_to have_content('You don\'t have starred projects yet')
end
end
end end
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