-
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.
Passes all model tests for teachers having appropriate columns in dat…
…abase, as well as basic feature tests for teacher's being able to view their dashboard
- Loading branch information
1 parent
3babdeb
commit d3a813f
Showing
8 changed files
with
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
class DashboardController < ApplicationController | ||
before_action :authenticate_student!, :expect => [:index] | ||
|
||
def index | ||
@student = current_student | ||
@teacher = current_teacher | ||
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,7 @@ | ||
<%= @student.email %>'s dashboard | ||
<%= link_to "My profile", student_profile_path(:id => @student.id) %> | ||
<% if current_student %> | ||
<%= @student.email %>'s dashboard | ||
<%= link_to "My profile", student_profile_path(:id => @student.id) %> | ||
<% elsif current_teacher %> | ||
<%= @teacher.email %>'s dashboard | ||
<a href="#">My Profile</a> | ||
<% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
def student_sign_up(email='[email protected]', password='testtest', password_confirmation='testtest') | ||
visit '/students/sign_up' | ||
visit '/' | ||
click_link 'Student sign in' | ||
click_link 'Sign up' | ||
fill_in 'Email', with: email | ||
fill_in 'Password', with: password | ||
fill_in 'Password confirmation', with: password_confirmation | ||
click_button 'Sign up' | ||
end | ||
|
||
def teacher_sign_up(email='[email protected]', password='testtest', password_confirmation='testtest') | ||
visit '/teachers/sign_up' | ||
visit '/' | ||
click_link 'Teacher sign in' | ||
click_link 'Sign up' | ||
fill_in 'Email', with: email | ||
fill_in 'Password', with: password | ||
fill_in 'Password confirmation', with: password_confirmation | ||
|
@@ -16,7 +20,7 @@ def teacher_sign_up(email='[email protected]', password='testtest', password_conf | |
|
||
def student_log_out_then_sign_in | ||
click_link 'Log out' | ||
click_link 'Sign in' | ||
click_link 'Student sign in' | ||
fill_in 'Email', with: '[email protected]' | ||
fill_in 'Password', with: 'testtest' | ||
click_button 'Log in' | ||
|