-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathweb_helper.rb
70 lines (63 loc) · 2.12 KB
/
web_helper.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
def student_sign_up(email='[email protected]', password='testtest', password_confirmation='testtest')
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 '/'
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
click_button 'Sign up'
end
def teacher_sign_in(email='[email protected]', password='testtest')
visit '/'
click_link 'Teacher sign in'
fill_in 'Email', with: email
fill_in 'Password', with: password
click_button 'Log in'
end
def student_sign_in(email='[email protected]', password='testtest')
visit '/'
click_link 'Student sign in'
fill_in 'Email', with: email
fill_in 'Password', with: password
click_button 'Log in'
end
def student_log_out_then_sign_in
click_link 'Log out'
click_link 'Student sign in'
fill_in 'Email', with: '[email protected]'
fill_in 'Password', with: 'testtest'
click_button 'Log in'
end
def teacher_log_out_then_sign_in
click_link 'Log out'
click_link 'Teacher sign in'
fill_in 'Email', with: '[email protected]'
fill_in 'Password', with: 'testtest'
click_button 'Log in'
end
def make_student_profile(name='Test student', native_language='French', learning_objectives='Learn english', skype='studentskype')
click_link 'My profile'
click_link 'Create Profile'
fill_in 'Name', with: name
fill_in 'Skype username', with: skype
fill_in 'Native language', with: native_language
fill_in 'Learning objectives', with: learning_objectives
click_button 'Create Student profile'
end
def make_teacher_profile(name='Test teacher', bio='I am a great teacher', skype='teacherskype')
click_link 'My profile'
click_link 'Create Profile'
fill_in 'Name', with: name
fill_in 'Bio', with: bio
fill_in 'Skype username', with: skype
click_button 'Create Teacher profile'
end