mumuki-laboratory 8.6.0 → 9.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/mumuki_laboratory/application/certificate.js +17 -0
  3. data/app/assets/javascripts/mumuki_laboratory/application/faqs.js +90 -0
  4. data/app/assets/javascripts/mumuki_laboratory/application/upload.js +69 -14
  5. data/app/assets/javascripts/mumuki_laboratory/application/user.js +16 -5
  6. data/app/assets/stylesheets/mumuki_laboratory/application/_layout.scss +3 -0
  7. data/app/assets/stylesheets/mumuki_laboratory/application/_modules.scss +3 -0
  8. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_certificate.scss +33 -0
  9. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_content_show.scss +15 -2
  10. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_faqs.scss +84 -0
  11. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_medal.scss +1 -1
  12. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_user_menu.scss +63 -0
  13. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_user_profile.scss +11 -0
  14. data/app/controllers/api/base_controller.rb +0 -1
  15. data/app/controllers/api/courses_controller.rb +1 -1
  16. data/app/controllers/api/organizations_controller.rb +5 -2
  17. data/app/controllers/api/roles_controller.rb +4 -0
  18. data/app/controllers/api/users_controller.rb +6 -1
  19. data/app/controllers/certificates_controller.rb +28 -0
  20. data/app/controllers/concerns/with_authorization.rb +1 -16
  21. data/app/controllers/concerns/with_certificate_render.rb +25 -0
  22. data/app/controllers/concerns/with_user_params.rb +4 -0
  23. data/app/controllers/discussions_messages_controller.rb +0 -1
  24. data/app/controllers/faqs_controller.rb +6 -0
  25. data/app/controllers/users_controller.rb +12 -5
  26. data/app/helpers/breadcrumbs_helper.rb +4 -0
  27. data/app/helpers/certificate_helper.rb +13 -0
  28. data/app/helpers/content_view_helper.rb +19 -0
  29. data/app/helpers/exercise_input_helper.rb +8 -17
  30. data/app/helpers/links_helper.rb +11 -3
  31. data/app/helpers/menu_bar_helper.rb +15 -11
  32. data/app/helpers/user_menu_helper.rb +36 -0
  33. data/app/mailers/application_mailer.rb +0 -1
  34. data/app/mailers/user_mailer.rb +9 -0
  35. data/app/views/certificates/_certificate.html.erb +44 -0
  36. data/app/views/certificates/_download.html.erb +20 -0
  37. data/app/views/certificates/verify.html.erb +40 -0
  38. data/app/views/chapters/show.html.erb +15 -14
  39. data/app/views/complements/show.html.erb +1 -1
  40. data/app/views/exams/show.html.erb +1 -1
  41. data/app/views/{layouts → exercises}/_exercise_skipped.html.erb +0 -0
  42. data/app/views/exercises/_exercise_title_icons.html.erb +4 -0
  43. data/app/views/exercises/show.html.erb +4 -7
  44. data/app/views/faqs/index.html.erb +20 -0
  45. data/app/views/{layouts → guides}/_guide.html.erb +0 -0
  46. data/app/views/guides/_guide_container.html.erb +24 -0
  47. data/app/views/{layouts → guides}/_guide_title_icons.html.erb +1 -3
  48. data/app/views/layouts/_progress_listing.html.erb +1 -1
  49. data/app/views/layouts/_user_menu.html.erb +17 -0
  50. data/app/views/layouts/application.html.erb +6 -1
  51. data/app/views/layouts/exercise_inputs/editors/_code.html.erb +2 -1
  52. data/app/views/layouts/exercise_inputs/editors/_upload.html.erb +11 -2
  53. data/app/views/lessons/show.html.erb +1 -1
  54. data/app/views/user_mailer/certificate.html.erb +339 -0
  55. data/app/views/user_mailer/certificate.text.erb +10 -0
  56. data/app/views/users/_user_form.html.erb +10 -8
  57. data/app/views/users/certificates.html.erb +32 -0
  58. data/app/views/users/discussions.html.erb +28 -0
  59. data/app/views/users/edit.html.erb +1 -1
  60. data/app/views/users/messages.html.erb +27 -0
  61. data/app/views/users/show.html.erb +4 -51
  62. data/app/views/users/terms.html.erb +2 -2
  63. data/config/routes.rb +9 -0
  64. data/lib/mumuki/laboratory/locales/en.yml +13 -3
  65. data/lib/mumuki/laboratory/locales/es-CL.yml +13 -3
  66. data/lib/mumuki/laboratory/locales/es.yml +12 -2
  67. data/lib/mumuki/laboratory/locales/pt.yml +12 -2
  68. data/lib/mumuki/laboratory/version.rb +1 -1
  69. data/spec/controllers/certificates_controller_spec.rb +15 -0
  70. data/spec/controllers/organizations_api_controller_spec.rb +16 -9
  71. data/spec/dummy/db/schema.rb +25 -1
  72. data/spec/features/certificate_programs_flow_spec.rb +17 -0
  73. data/spec/features/exercise_flow_spec.rb +3 -3
  74. data/spec/features/login_flow_spec.rb +1 -1
  75. data/spec/features/menu_bar_spec.rb +44 -24
  76. data/spec/features/profile_flow_spec.rb +18 -9
  77. data/spec/features/terms_flow_spec.rb +30 -0
  78. data/spec/helpers/application_helper_spec.rb +10 -0
  79. data/spec/helpers/certificate_helper_spec.rb +15 -0
  80. data/spec/javascripts/upload-spec.js +80 -0
  81. metadata +86 -14
  82. data/app/views/layouts/_guide_container.html.erb +0 -28
@@ -33,6 +33,10 @@ pt:
33
33
  birthdate: Fecha de nacimiento
34
34
  blocked_forum_explanation: Você está no meio de um exame agora?
35
35
  cancel: Cancelar
36
+ certificate: Certificado
37
+ certificates: Certificados
38
+ certificates_will_be_here: Seus certificados nesta organização aparecerão aqui
39
+ certificate_verified_legend: "A conta de <strong>% {full_name} </strong> foi verificada. Mumuki certifica a conclusão com sucesso de <strong>% {description} </strong>."
36
40
  chapter: Capítulo
37
41
  chapters: Capítulos
38
42
  chapter_finished_html: Você terminou %{chapter}! Parabéns!
@@ -43,6 +47,7 @@ pt:
43
47
  closed: Fechado
44
48
  closed_count: '%{count} fechado'
45
49
  comment: Comentar
50
+ completed_by: Completado por
46
51
  confirm: Confirme
47
52
  confirm_reset: Você está prestes a reiniciar seu exercício. Você quer continuar?
48
53
  confirm_restart: Você está prestes a apagar o seu progresso neste guia. Você quer continuar?
@@ -72,6 +77,7 @@ pt:
72
77
  new_discussion_message: Nova mensagem em %{title}
73
78
  discussion_updated: Consulta actualizada
74
79
  discussions: Consultas
80
+ discussions_will_be_here: As perguntas que você fizer no espaço de consulta aparecerão aqui.
75
81
  download: Faça o download do que você fez
76
82
  edit: Editar
77
83
  edit_profile: Editar perfil
@@ -111,8 +117,10 @@ pt:
111
117
  expected_state: Tabuleiro esperado
112
118
  explain_redirect: Percebemos que você se registrou em outra organização.
113
119
  failed: Sua solução não passou as provas
120
+ faqs: Perguntas frequentes
114
121
  feedback: Problemas que encontramos
115
122
  female: Feminino
123
+ file_exceeds_max_size: "O tamanho do arquivo não deve exceder %{size_kb}kb. Selecione outro arquivo."
116
124
  finish: Terminar
117
125
  first_name: Nome
118
126
  forbidden_explanation: Você poderia ter entrado com uma conta incorreta?
@@ -157,6 +165,7 @@ pt:
157
165
  let_us_know: Por favor, avise-nos!
158
166
  level: Nível
159
167
  level_up: Você sobe de nível!
168
+ linkedin_profile_button_locale: pt_BR
160
169
  listen_statement: Ouça a declaração
161
170
  loading: Carregando
162
171
  load_solution_into_console: Carregue a solução no console
@@ -175,7 +184,9 @@ pt:
175
184
  moderation: Mentoria
176
185
  moderator: Mentor
177
186
  more_messages: Ver as mensagens anteriores
187
+ my_account: Minha conta
178
188
  my_doubts: Minhas duvidas
189
+ my_profile: Meu perfil
179
190
  name: Nome
180
191
  navigation_continue: "Próximo %{kind}: %{sibling}"
181
192
  navigation_next: Próximo %{kind}
@@ -224,7 +235,6 @@ pt:
224
235
  previous_exercise: Anterior
225
236
  problem_with_exercise: '[Mumuki] Erro com exercício %{title}'
226
237
  processing_your_solution: Estamos processando sua solução
227
- profile: Perfil
228
238
  profile_of: Perfil de %{username}
229
239
  programming_since: Sou programador
230
240
  progress: Progresso
@@ -240,6 +250,7 @@ pt:
240
250
  running: processamento
241
251
  save: Salvar
242
252
  see_context: Veja a animação desde o início
253
+ select_file: Selecione o arquivo
243
254
  send: Enviar
244
255
  sending_solution: Solução de envio
245
256
  show: Mostrar
@@ -296,7 +307,6 @@ pt:
296
307
  unmeet_expectations: Objetivos que não foram atendidos
297
308
  unprepared_organization_explanation: Este curso ainda não começou
298
309
  unsubscribe: Cancelar subscrição
299
- upload_solution: Carregar solução
300
310
  uploading_solution: Uploading solution
301
311
  user: Usuário
302
312
  user_data_updated: Os seus dados foram atualizados corretamente
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Laboratory
3
- VERSION = '8.6.0'
3
+ VERSION = '9.0.3'
4
4
  end
5
5
  end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ describe CertificatesController, type: :controller, organization_workspace: :test do
4
+ let(:user) { create(:user) }
5
+ let(:certificate) { create(:certificate, user: user) }
6
+
7
+ context 'download' do
8
+ before { set_current_user! user }
9
+ before { get :download, params: { code: certificate.code } }
10
+
11
+ it { expect(response.status).to eq 200 }
12
+ it { expect(response.body).to_not be_nil }
13
+ it { expect(response.content_type).to eq 'application/pdf' }
14
+ end
15
+ end
@@ -34,7 +34,7 @@ describe Api::OrganizationsController, type: :controller, organization_workspace
34
34
 
35
35
  context 'with wildcard permissions' do
36
36
  before { get :index }
37
- let(:api_client) { create :api_client, role: :janitor, grant: '*' }
37
+ let(:api_client) { create :api_client, role: :admin, grant: '*' }
38
38
 
39
39
  it { check_status! 200 }
40
40
 
@@ -42,7 +42,7 @@ describe Api::OrganizationsController, type: :controller, organization_workspace
42
42
  end
43
43
  context 'with non-wildcard permissions' do
44
44
  before { get :index }
45
- let(:api_client) { create :api_client, role: :janitor, grant: 'public/*:private/*' }
45
+ let(:api_client) { create :api_client, role: :admin, grant: 'public/*:private/*' }
46
46
 
47
47
  it { check_status! 200 }
48
48
 
@@ -54,14 +54,14 @@ describe Api::OrganizationsController, type: :controller, organization_workspace
54
54
  context 'with a public organization' do
55
55
  before { get :show, params: {id: 'public'} }
56
56
 
57
- context 'with a user without janitor permissions' do
57
+ context 'with a user without admin permissions' do
58
58
  let(:api_client) { create :api_client, role: :editor, grant: 'another_organization/*' }
59
59
 
60
60
  it { check_status! 403 }
61
61
  end
62
62
 
63
- context 'with a user with janitor' do
64
- let(:api_client) { create :api_client, role: :janitor, grant: 'public/*' }
63
+ context 'with a user with admin' do
64
+ let(:api_client) { create :api_client, role: :admin, grant: 'public/*' }
65
65
 
66
66
  it { check_status! 200 }
67
67
  end
@@ -70,7 +70,7 @@ describe Api::OrganizationsController, type: :controller, organization_workspace
70
70
  context 'with an organization that has a dot in its name' do
71
71
  before { get :show, params: {id: 'dot.org'} }
72
72
 
73
- let(:api_client) { create :api_client, role: :janitor, grant: 'dot.org/*' }
73
+ let(:api_client) { create :api_client, role: :admin, grant: 'dot.org/*' }
74
74
  it { check_status! 200 }
75
75
  end
76
76
 
@@ -84,7 +84,7 @@ describe Api::OrganizationsController, type: :controller, organization_workspace
84
84
  end
85
85
 
86
86
  context 'with a user with permissions' do
87
- let(:api_client) { create :api_client, role: :janitor, grant: 'private/*' }
87
+ let(:api_client) { create :api_client, role: :admin, grant: 'private/*' }
88
88
 
89
89
  it { check_status! 200 }
90
90
  it { expect(response.body).to json_like(private_organization.to_resource_h) }
@@ -181,7 +181,7 @@ describe Api::OrganizationsController, type: :controller, organization_workspace
181
181
  end
182
182
 
183
183
 
184
- context 'with not-janitor permissions' do
184
+ context 'with non-admin permissions' do
185
185
  let(:api_client) { create :api_client, role: :editor, grant: '*' }
186
186
 
187
187
  it { check_status! 403 }
@@ -228,7 +228,14 @@ describe Api::OrganizationsController, type: :controller, organization_workspace
228
228
  it { expect(updated_organizaton.contact_email).to eq 'second_email@gmail.com' }
229
229
  end
230
230
 
231
- context 'with not-janitor permissions' do
231
+ context 'with janitor permissions' do
232
+ let(:api_client) { create :api_client, role: :janitor, grant: 'existing-organization/*' }
233
+ before { put :update, params: {id: 'existing-organization', organization: update_json} }
234
+
235
+ it { check_status! 403 }
236
+ end
237
+
238
+ context 'with non-admin permissions' do
232
239
  let(:api_client) { create :api_client, role: :teacher, grant: 'existing-organization/*' }
233
240
  before { put :update, params: {id: 'existing-organization', organization: update_json} }
234
241
 
@@ -10,7 +10,7 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 20210119190204) do
13
+ ActiveRecord::Schema.define(version: 20210302181654) do
14
14
 
15
15
  # These are extensions that must be enabled in order to support this database
16
16
  enable_extension "plpgsql"
@@ -71,6 +71,29 @@ ActiveRecord::Schema.define(version: 20210119190204) do
71
71
  t.index ["slug"], name: "index_books_on_slug", unique: true
72
72
  end
73
73
 
74
+ create_table "certificate_programs", force: :cascade do |t|
75
+ t.string "title"
76
+ t.string "template_html_erb"
77
+ t.text "description"
78
+ t.string "background_image_url"
79
+ t.bigint "organization_id"
80
+ t.datetime "created_at", null: false
81
+ t.datetime "updated_at", null: false
82
+ t.index ["organization_id"], name: "index_certificate_programs_on_organization_id"
83
+ end
84
+
85
+ create_table "certificates", force: :cascade do |t|
86
+ t.bigint "user_id"
87
+ t.bigint "certificate_program_id"
88
+ t.datetime "start_date"
89
+ t.datetime "end_date"
90
+ t.string "code"
91
+ t.datetime "created_at", null: false
92
+ t.datetime "updated_at", null: false
93
+ t.index ["certificate_program_id"], name: "index_certificates_on_certificate_program_id"
94
+ t.index ["user_id"], name: "index_certificates_on_user_id"
95
+ end
96
+
74
97
  create_table "chapters", id: :serial, force: :cascade do |t|
75
98
  t.datetime "created_at"
76
99
  t.datetime "updated_at"
@@ -377,6 +400,7 @@ ActiveRecord::Schema.define(version: 20210119190204) do
377
400
  t.boolean "wins_page"
378
401
  t.boolean "immersible"
379
402
  t.boolean "prevent_manual_evaluation_content"
403
+ t.text "faqs"
380
404
  t.index ["book_id"], name: "index_organizations_on_book_id"
381
405
  t.index ["name"], name: "index_organizations_on_name", unique: true
382
406
  end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ feature 'Certificate Programs flow', organization_workspace: :test do
4
+
5
+ let(:user) { create :user, first_name: 'Foo', last_name: 'Bar' }
6
+
7
+ before { set_current_user! user }
8
+
9
+ before { Organization.find_by_name('test').switch! }
10
+ before { create :certificate, user: user, code: 'abc' }
11
+
12
+ before { visit '/certificates/verify/abc' }
13
+
14
+ scenario { expect(page).to have_text('Foo Bar') }
15
+ scenario { expect(page).to have_link(href: /linkedin\.com\/profile\/add/) }
16
+ scenario { expect(page).to have_link(href: /certificates\/download\/abc/) }
17
+ end
@@ -106,19 +106,19 @@ feature 'Exercise Flow', organization_workspace: :test do
106
106
  scenario 'visit exercise by id, standalone mode' do
107
107
  visit "/exercises/#{problem_1.id}"
108
108
  expect(page).to have_text('Functional Programming 1')
109
- expect(page).to have_text('Profile')
109
+ expect(page).to have_text('My account')
110
110
  end
111
111
  scenario 'visit exercise by id, embedded mode in non embeddable organization' do
112
112
  visit "/exercises/#{problem_1.id}?embed=true"
113
113
  expect(page).to have_text('Functional Programming 1')
114
- expect(page).to have_text('Profile')
114
+ expect(page).to have_text('My account')
115
115
  end
116
116
  scenario 'visit exercise by id, embedded mode in embeddable organization' do
117
117
  Organization.current.tap { |it| it.embeddable = true }.save!
118
118
 
119
119
  visit "/exercises/#{problem_1.id}?embed=true"
120
120
  expect(page).to_not have_text('Functional Programming 1')
121
- expect(page).to_not have_text('Profile')
121
+ expect(page).to_not have_text('My account')
122
122
  end
123
123
  end
124
124
 
@@ -64,6 +64,6 @@ feature 'Login Flow', organization_workspace: :test do
64
64
 
65
65
  expect(page).to_not have_text('Sign in')
66
66
  expect(page).to have_text('Sign Out')
67
- expect(page).to have_text('Profile')
67
+ expect(page).to have_text('My profile')
68
68
  end
69
69
  end
@@ -16,9 +16,10 @@ feature 'menu bar' do
16
16
  scenario 'should not see menu bar' do
17
17
  visit '/'
18
18
 
19
- expect(page).not_to have_text('Profile')
19
+ expect(page).not_to have_text('My account')
20
20
  expect(page).not_to have_text('Classroom')
21
21
  expect(page).not_to have_text('Bibliotheca')
22
+ expect(page).not_to have_text('FAQs')
22
23
  end
23
24
  end
24
25
 
@@ -30,11 +31,12 @@ feature 'menu bar' do
30
31
  scenario 'should not see menu bar' do
31
32
  visit '/'
32
33
 
33
- expect(page).not_to have_text('Profile')
34
+ expect(page).not_to have_text('My account')
34
35
  expect(page).not_to have_text('Classroom')
35
36
  expect(page).not_to have_text('Bibliotheca')
36
37
  expect(page).not_to have_text('Solve other\'s doubts')
37
38
  expect(page).not_to have_text('My doubts')
39
+ expect(page).not_to have_text('FAQs')
38
40
  end
39
41
  end
40
42
  end
@@ -48,55 +50,69 @@ feature 'menu bar' do
48
50
  let(:admin) { create(:user, permissions: {student: 'private/*', admin: 'private/*'}) }
49
51
  let(:owner) { create(:user, permissions: {student: 'private/*', owner: 'private/*'}) }
50
52
 
51
- scenario 'visitor should only see profile' do
53
+ scenario 'visitor should only see their account' do
52
54
  set_current_user! visitor
53
55
 
54
56
  visit '/'
55
- expect(page).to have_text('Profile')
57
+ expect(page).to have_text('My account')
56
58
  expect(page).not_to have_text('Classroom')
57
59
  expect(page).not_to have_text('Bibliotheca')
58
60
  expect(page).not_to have_text('Solve other\'s doubts')
59
61
  expect(page).not_to have_text('My doubts')
62
+ expect(page).not_to have_text('FAQs')
60
63
  end
61
64
 
62
65
  context 'student with no discussions should' do
63
- scenario 'only see profile if forum is not enabled' do
66
+ scenario 'only see their account if forum is not enabled' do
64
67
  set_current_user! student
65
68
 
66
69
  visit '/'
67
- expect(page).to have_text('Profile')
70
+ expect(page).to have_text('My account')
68
71
  expect(page).not_to have_text('Classroom')
69
72
  expect(page).not_to have_text('Bibliotheca')
70
73
  expect(page).not_to have_text('Solve other\'s doubts')
71
74
  expect(page).not_to have_text('My doubts')
75
+ expect(page).not_to have_text('FAQs')
72
76
  end
73
77
 
74
- scenario 'see profile and solve_other_doubts links if forum is enabled' do
78
+ scenario 'see their account and solve_other_doubts links if forum is enabled' do
75
79
  set_current_user! student
76
80
  private_organization.update! forum_enabled: true
77
81
 
78
82
  visit '/'
79
- expect(page).to have_text('Profile')
83
+ expect(page).to have_text('My account')
80
84
  expect(page).not_to have_text('Classroom')
81
85
  expect(page).not_to have_text('Bibliotheca')
82
86
  expect(page).to have_text('Solve other\'s doubts')
83
87
  expect(page).not_to have_text('My doubts')
88
+ expect(page).not_to have_text('FAQs')
89
+ end
90
+ end
91
+
92
+ context 'organization with faqs' do
93
+ before { Organization.current.update! faqs: "Some faqs" }
94
+
95
+ scenario 'should see FAQs link' do
96
+ visit '/'
97
+
98
+ expect(page).to have_text('FAQs')
84
99
  end
85
100
  end
86
101
 
87
102
  context 'student with discussions should' do
88
103
  let(:discussion) { create(:discussion, item: lesson.exercises.last, initiator: student)}
89
104
 
90
- scenario 'only see profile if forum is not enabled' do
105
+ scenario 'only see their account if forum is not enabled' do
91
106
  set_current_user! student
92
107
  student.subscribe_to! discussion
93
108
 
94
109
  visit '/'
95
- expect(page).to have_text('Profile')
110
+ expect(page).to have_text('My account')
96
111
  expect(page).not_to have_text('Classroom')
97
112
  expect(page).not_to have_text('Bibliotheca')
98
113
  expect(page).not_to have_text('Solve other\'s doubts')
99
114
  expect(page).not_to have_text('My doubts')
115
+ expect(page).not_to have_text('FAQs')
100
116
  end
101
117
 
102
118
  scenario 'see all discussions links if forum is enabled' do
@@ -105,25 +121,27 @@ feature 'menu bar' do
105
121
  student.subscribe_to! discussion
106
122
 
107
123
  visit '/'
108
- expect(page).to have_text('Profile')
124
+ expect(page).to have_text('My account')
109
125
  expect(page).not_to have_text('Classroom')
110
126
  expect(page).not_to have_text('Bibliotheca')
111
127
  expect(page).to have_text('Solve other\'s doubts')
112
128
  expect(page).to have_text('My doubts')
129
+ expect(page).not_to have_text('FAQs')
113
130
  end
114
131
 
115
- scenario 'only see profile if forum is enabled in a forum_only_for_trusted organization' do
132
+ scenario 'only see their account if forum is enabled in a forum_only_for_trusted organization' do
116
133
  set_current_user! student
117
134
  student.subscribe_to! discussion
118
135
  private_organization.update! forum_enabled: true
119
136
  private_organization.update! forum_only_for_trusted: true
120
137
 
121
138
  visit '/'
122
- expect(page).to have_text('Profile')
139
+ expect(page).to have_text('My account')
123
140
  expect(page).not_to have_text('Classroom')
124
141
  expect(page).not_to have_text('Bibliotheca')
125
142
  expect(page).not_to have_text('Solve other\'s doubts')
126
143
  expect(page).not_to have_text('My doubts')
144
+ expect(page).not_to have_text('FAQs')
127
145
  end
128
146
 
129
147
  scenario 'see all discussions links if forum is enabled in a forum_only_for_trusted organization but it is trusted' do
@@ -134,62 +152,64 @@ feature 'menu bar' do
134
152
  private_organization.update! forum_only_for_trusted: true
135
153
 
136
154
  visit '/'
137
- expect(page).to have_text('Profile')
155
+ expect(page).to have_text('My account')
138
156
  expect(page).not_to have_text('Classroom')
139
157
  expect(page).not_to have_text('Bibliotheca')
140
158
  expect(page).to have_text('Solve other\'s doubts')
141
159
  expect(page).to have_text('My doubts')
160
+ expect(page).not_to have_text('FAQs')
142
161
  end
143
162
  end
144
163
 
145
- scenario 'teacher should see profile and classroom' do
164
+ scenario 'teacher should see their account and classroom' do
146
165
  set_current_user! teacher
147
166
 
148
167
  visit '/'
149
168
 
150
- expect(page).to have_text('Profile')
169
+ expect(page).to have_text('My account')
151
170
  expect(page).to have_text('Classroom')
152
171
  expect(page).not_to have_text('Bibliotheca')
153
172
  expect(page).not_to have_text('Solve other\'s doubts')
154
173
  expect(page).not_to have_text('My doubts')
174
+ expect(page).not_to have_text('FAQs')
155
175
  end
156
176
 
157
- scenario 'writer should see profile and bibliotheca' do
177
+ scenario 'writer should see their account and bibliotheca' do
158
178
  set_current_user! writer
159
179
 
160
180
  visit '/'
161
181
 
162
- expect(page).to have_text('Profile')
182
+ expect(page).to have_text('My account')
163
183
  expect(page).not_to have_text('Classroom')
164
184
  expect(page).to have_text('Bibliotheca')
165
185
  end
166
186
 
167
- scenario 'janitor should see profile and classroom' do
187
+ scenario 'janitor should see their account and classroom' do
168
188
  set_current_user! janitor
169
189
 
170
190
  visit '/'
171
191
 
172
- expect(page).to have_text('Profile')
192
+ expect(page).to have_text('My account')
173
193
  expect(page).to have_text('Classroom')
174
194
  expect(page).not_to have_text('Bibliotheca')
175
195
  end
176
196
 
177
- scenario 'admin should see profile, classroom and bibliotheca' do
197
+ scenario 'admin should their account, classroom and bibliotheca' do
178
198
  set_current_user! admin
179
199
 
180
200
  visit '/'
181
201
 
182
- expect(page).to have_text('Profile')
202
+ expect(page).to have_text('My account')
183
203
  expect(page).to have_text('Classroom')
184
204
  expect(page).to have_text('Bibliotheca')
185
205
  end
186
206
 
187
- scenario 'owner should see profile, classroom and bibliotheca' do
207
+ scenario 'owner should see their account, classroom and bibliotheca' do
188
208
  set_current_user! owner
189
209
 
190
210
  visit '/'
191
211
 
192
- expect(page).to have_text('Profile')
212
+ expect(page).to have_text('My account')
193
213
  expect(page).to have_text('Classroom')
194
214
  expect(page).to have_text('Bibliotheca')
195
215
  end