-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f726ab0
commit 4f7031d
Showing
2 changed files
with
26 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require "test_helper" | ||
|
||
class NavigationItemsHelperTest < ActionView::TestCase | ||
context "NavigationItemsHelper" do | ||
should "include editor only links when user is an editor" do | ||
assert_equal [ | ||
{ text: "Publications", href: root_path }, | ||
{ text: 'Add artefact', href: new_artefact_path }, | ||
{ text: 'Downtime', href: downtimes_path }, | ||
{ text: 'Reports', href: reports_path }, | ||
{ text: 'Search by user', href: user_search_path }, | ||
{ text: 'Sign out', href: '/auth/gds/sign_out' } | ||
], navigation_items(true) | ||
end | ||
|
||
should "include not include editor only links when user is not an editor" do | ||
assert_equal [ | ||
{ text: "Publications", href: root_path }, | ||
{ text: 'Reports', href: reports_path }, | ||
{ text: 'Search by user', href: user_search_path }, | ||
{ text: 'Sign out', href: '/auth/gds/sign_out' } | ||
], navigation_items(false) | ||
end | ||
end | ||
end |