Skip to content

Commit

Permalink
[frontend] Always present notification icon
Browse files Browse the repository at this point in the history
There is no other way to get to user_tasks_path, so always show this.
Switch to an icon because this is easier to grasp as text and for most
people the number of tasks is not important, but that there are tasks.
  • Loading branch information
hennevogel committed Mar 27, 2018
1 parent b6d3130 commit ed7fe9e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
- if User.current && !User.current.is_nobody?
= link_to(home_path, id: 'link-to-user-home') do
= User.current.login
|
- tasks = User.current.tasks
- if tasks > 0
|
= link_to(user_tasks_path, title: 'where an action is requested from you') do
= pluralize(tasks, 'Task')
= link_to(user_tasks_path) do
%span{title: 'where an action is requested from you' }
= pluralize(tasks, 'Task')
- else
Tasks
|
- if User.current.home_project
= link_to 'Home Project', project_show_path(User.current.home_project)
Expand Down
16 changes: 12 additions & 4 deletions src/api/spec/features/webui/login_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,17 @@

scenario 'login with home project shows a link to it' do
login user
expect(page).to have_content "#{user.login} | Home Project | Logout"
within('#subheader') do
expect(page).to have_link('Home Project')
end
end

scenario 'login without home project shows a link to create it' do
user.home_project.destroy
login user
expect(page).to have_content "#{user.login} | Create Home | Logout"
within('#subheader') do
expect(page).to have_link('Create Home')
end
end

scenario 'login via login page' do
Expand Down Expand Up @@ -133,7 +137,9 @@
page.driver.add_header('AUTHORIZATION', "Negotiate #{Base64.strict_encode64(ticket)}")

click_link('Log In')
expect(page).to have_content "#{login} | Home Project | Logout"
within('#subheader') do
expect(page).to have_link('Home Project')
end
end
end

Expand All @@ -155,7 +161,9 @@
page.driver.add_header('AUTHORIZATION', "Negotiate #{Base64.strict_encode64('ticket')}")

click_link('Log In')
expect(page).not_to have_content '| Home Project | Logout'
within('#subheader') do
expect(page).not_to have_link('Home Project')
end
expect(find('.flash-content')).to have_text "Authentication failed: 'Received a GSSAPI exception"
expect(find('.flash-content')).to have_text "couldn't validate ticket"
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

click_button('Create Project')
expect(page).to have_content("Project '#{user.home_project_name}' was created successfully")
expect(page).to have_content "#{user.login} | Home Project | Logout"
expect(user.home_project).not_to be_nil
end
end

0 comments on commit ed7fe9e

Please sign in to comment.