-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from enpitut2018/account-specific-tasks
ログインユーザー別に表示するタスク・予定を分岐させる処理を追加
- Loading branch information
Showing
15 changed files
with
83 additions
and
27 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
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,2 +1,11 @@ | ||
module ScheduleHelper | ||
|
||
def get_available_schedules | ||
if user_signed_in? then | ||
Schedule.where(:user_id => current_user.email) | ||
else | ||
Schedule.where(:user_id => nil) | ||
end | ||
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 |
---|---|---|
@@ -1,2 +1,11 @@ | ||
module TaskHelper | ||
|
||
def get_available_tasks | ||
if user_signed_in? then | ||
Task.where(:user_id => current_user.email) | ||
else | ||
Task.where(:user_id => nil) | ||
end | ||
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
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
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
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
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,14 +1,31 @@ | ||
require 'test_helper' | ||
|
||
class SessionsControllerTest < ActionDispatch::IntegrationTest | ||
test "should get login" do | ||
get sessions_login_url | ||
assert_response :success | ||
|
||
test 'should not get login' do | ||
# ログイン用のURLは "/login" に設定されており, "/sessions/login" は使用できない | ||
assert_raises(ActionController::RoutingError) do | ||
get '/sessions/login' | ||
end | ||
end | ||
|
||
test 'should not get logout' do | ||
# ログアウト用のURLは "/logout" に設定されており, "/sessions/logout" は使用できない | ||
assert_raises(ActionController::RoutingError) do | ||
get '/sessions/logout' | ||
end | ||
end | ||
|
||
test 'should be redirected to google authentication page' do | ||
# ログイン用のURLにアクセスするとGoogleの認証ページにリダイレクトされる | ||
get '/login' | ||
assert_response :redirect | ||
end | ||
|
||
test "should get logout" do | ||
get sessions_logout_url | ||
assert_response :success | ||
test 'should get logout' do | ||
# ログアウト用のURLに(未ログイン状態で)アクセスするとトップページにリダイレクトされる | ||
get '/logout' | ||
assert_response :redirect | ||
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