Commit ceac0ae6 authored by Phil Hughes's avatar Phil Hughes

Merge branch '41117-empty-state' into 'master'

Only render signout screen when user is signed out

Closes #41117 and #39843

See merge request gitlab-org/gitlab-ce!15935
parents c9041508 e4b72248
...@@ -8,11 +8,12 @@ ...@@ -8,11 +8,12 @@
= image_tag 'illustrations/issues.svg' = image_tag 'illustrations/issues.svg'
.col-xs-12 .col-xs-12
.text-content .text-content
- if has_button && current_user - if current_user
%h4 %h4
= _("The Issue Tracker is the place to add things that need to be improved or solved in a project") = _("The Issue Tracker is the place to add things that need to be improved or solved in a project")
%p %p
= _("Issues can be bugs, tasks or ideas to be discussed. Also, issues are searchable and filterable.") = _("Issues can be bugs, tasks or ideas to be discussed. Also, issues are searchable and filterable.")
- if has_button
.text-center .text-center
- if project_select_button - if project_select_button
= render 'shared/new_project_item_select', path: 'issues/new', label: 'New issue', type: :issues = render 'shared/new_project_item_select', path: 'issues/new', label: 'New issue', type: :issues
......
...@@ -8,6 +8,19 @@ describe 'Issues' do ...@@ -8,6 +8,19 @@ describe 'Issues' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
describe 'while user is signed out' do
describe 'empty state' do
it 'user sees empty state' do
visit project_issues_path(project)
expect(page).to have_content('Register / Sign In')
expect(page).to have_content('The Issue Tracker is the place to add things that need to be improved or solved in a project.')
expect(page).to have_content('You can register or sign in to create issues for this project.')
end
end
end
describe 'while user is signed in' do
before do before do
sign_in(user) sign_in(user)
user2 = create(:user) user2 = create(:user)
...@@ -15,6 +28,16 @@ describe 'Issues' do ...@@ -15,6 +28,16 @@ describe 'Issues' do
project.team << [[user, user2], :developer] project.team << [[user, user2], :developer]
end end
describe 'empty state' do
it 'user sees empty state' do
visit project_issues_path(project)
expect(page).to have_content('The Issue Tracker is the place to add things that need to be improved or solved in a project')
expect(page).to have_content('Issues can be bugs, tasks or ideas to be discussed. Also, issues are searchable and filterable.')
expect(page).to have_content('New issue')
end
end
describe 'Edit issue' do describe 'Edit issue' do
let!(:issue) do let!(:issue) do
create(:issue, create(:issue,
...@@ -733,4 +756,5 @@ describe 'Issues' do ...@@ -733,4 +756,5 @@ describe 'Issues' do
expect(page).not_to have_css('.is-active') expect(page).not_to have_css('.is-active')
end end
end 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