提交 e4b72248 编写于 作者: F Filipa Lacerda 提交者: Phil Hughes

Only render signout screen when user is signed out

上级 c9041508
......@@ -8,11 +8,12 @@
= image_tag 'illustrations/issues.svg'
.col-xs-12
.text-content
- if has_button && current_user
- if current_user
%h4
= _("The Issue Tracker is the place to add things that need to be improved or solved in a project")
%p
= _("Issues can be bugs, tasks or ideas to be discussed. Also, issues are searchable and filterable.")
- if has_button
.text-center
- if project_select_button
= render 'shared/new_project_item_select', path: 'issues/new', label: 'New issue', type: :issues
......
......@@ -8,6 +8,19 @@ describe 'Issues' do
let(:user) { create(:user) }
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
sign_in(user)
user2 = create(:user)
......@@ -15,6 +28,16 @@ describe 'Issues' do
project.team << [[user, user2], :developer]
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
let!(:issue) do
create(:issue,
......@@ -733,4 +756,5 @@ describe 'Issues' do
expect(page).not_to have_css('.is-active')
end
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册