Skip to content

Commit

Permalink
add test to admins only path
Browse files Browse the repository at this point in the history
  • Loading branch information
christophwong committed Oct 9, 2018
1 parent adda873 commit a16a5d5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ul>
<li><%= link_to "home", root_path, :class => "active" %></li>
<li><%= link_to "members", members_only_path %></li>
<li><%= link_to "admin", static_pages_admin_only_path %></li>
<li><%= link_to "admin", admins_only_path %></li>
<li><%= link_to "Sign Out", users.sign_out_path, method: :delete %></li>
<li><%= link_to "Sign In", users.sign_in_path %></li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
root "static_pages#home"

get '/members_only', to: "static_pages#members_only"
get 'static_pages/admin_only'
get '/admins_only', to: "static_pages#admins_only"
passwordless_for :users
end
2 changes: 1 addition & 1 deletion test/controllers/router_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ class RouterTest < ActionDispatch::IntegrationTest
test 'routes' do
assert_routing '/', controller: 'static_pages', action: 'home'
assert_routing '/members_only', controller: 'static_pages', action: 'members_only'
# assert_routing '/admins_only', controller: 'static_pages', action: 'admins_only'
assert_routing '/admins_only', controller: 'static_pages', action: 'admins_only'
end
end

0 comments on commit a16a5d5

Please sign in to comment.