-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
root to home page, delete old home page route
- Loading branch information
1 parent
6467fd1
commit b2dc267
Showing
4 changed files
with
21 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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
Rails.application.routes.draw do | ||
get 'static_pages/home' | ||
root to: "static_pages#home" | ||
|
||
get 'static_pages/members_only' | ||
get 'static_pages/admin_only' | ||
root to: "static_pages#home" | ||
devise_for :users | ||
|
||
devise_for :users | ||
end |
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 |
---|---|---|
@@ -1,19 +1,27 @@ | ||
require 'test_helper' | ||
|
||
class StaticPagesControllerTest < ActionDispatch::IntegrationTest | ||
test "should get home" do | ||
get static_pages_home_url | ||
include Devise::Test::IntegrationHelpers | ||
|
||
test "should get home page" do | ||
get root_url | ||
assert_response :success | ||
end | ||
|
||
test "should get members_only" do | ||
test "should redirect user if not signed in" do | ||
get static_pages_members_only_url | ||
assert_redirected_to new_user_session_path | ||
end | ||
|
||
test "should get members only page after sign in" do | ||
sign_in users(:one) | ||
get static_pages_members_only_url | ||
assert_response :success | ||
end | ||
|
||
test "should get admin_only" do | ||
sign_in users(:one) | ||
get static_pages_admin_only_url | ||
assert_response :success | ||
assert_redirected_to root_path | ||
end | ||
|
||
end |
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 |
---|---|---|
|
@@ -4,8 +4,6 @@ | |
# model remove the '{}' from the fixture names and add the columns immediately | ||
# below each fixture, per the syntax in the comments below | ||
# | ||
one: {} | ||
# column: value | ||
# | ||
two: {} | ||
# column: value | ||
one: | ||
email: "[email protected]" | ||
encrypted_password: <%= Devise::Encryptor.digest(User, 'password') %> |