mumuki-laboratory 8.6.1 → 9.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) 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/organization.js +32 -0
  5. data/app/assets/javascripts/mumuki_laboratory/application/submissions-store.js +1 -1
  6. data/app/assets/javascripts/mumuki_laboratory/application/user.js +49 -5
  7. data/app/assets/stylesheets/mumuki_laboratory/application/_layout.scss +3 -0
  8. data/app/assets/stylesheets/mumuki_laboratory/application/_modules.scss +3 -0
  9. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_certificate.scss +33 -0
  10. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_content_show.scss +15 -2
  11. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_faqs.scss +84 -0
  12. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_medal.scss +1 -1
  13. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_user_menu.scss +63 -0
  14. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_user_profile.scss +11 -0
  15. data/app/controllers/api/base_controller.rb +0 -1
  16. data/app/controllers/api/courses_controller.rb +1 -1
  17. data/app/controllers/api/organizations_controller.rb +5 -2
  18. data/app/controllers/api/roles_controller.rb +4 -0
  19. data/app/controllers/api/users_controller.rb +6 -1
  20. data/app/controllers/certificates_controller.rb +28 -0
  21. data/app/controllers/concerns/with_authorization.rb +1 -16
  22. data/app/controllers/concerns/with_certificate_render.rb +25 -0
  23. data/app/controllers/concerns/with_user_params.rb +4 -0
  24. data/app/controllers/discussions_messages_controller.rb +0 -1
  25. data/app/controllers/faqs_controller.rb +6 -0
  26. data/app/controllers/users_controller.rb +12 -5
  27. data/app/helpers/breadcrumbs_helper.rb +4 -0
  28. data/app/helpers/certificate_helper.rb +13 -0
  29. data/app/helpers/content_view_helper.rb +19 -0
  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/_main.html.erb +4 -0
  49. data/app/views/layouts/_progress_listing.html.erb +1 -1
  50. data/app/views/layouts/_user_menu.html.erb +17 -0
  51. data/app/views/layouts/application.html.erb +6 -1
  52. data/app/views/layouts/exercise_inputs/editors/_code.html.erb +2 -1
  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 +1 -1
  63. data/config/routes.rb +9 -0
  64. data/lib/mumuki/laboratory/locales/en.yml +10 -1
  65. data/lib/mumuki/laboratory/locales/es-CL.yml +10 -1
  66. data/lib/mumuki/laboratory/locales/es.yml +10 -1
  67. data/lib/mumuki/laboratory/locales/pt.yml +10 -1
  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 +17 -7
  77. data/spec/helpers/application_helper_spec.rb +10 -0
  78. data/spec/helpers/certificate_helper_spec.rb +15 -0
  79. metadata +81 -10
  80. data/app/views/layouts/_guide_container.html.erb +0 -28
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Laboratory
3
- VERSION = '8.6.1'
3
+ VERSION = '9.0.4'
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
@@ -97,31 +97,41 @@ feature 'Profile Flow', organization_workspace: :test do
97
97
 
98
98
  click_on(button_options)
99
99
  expect(page).to have_text('Your data was updated successfully')
100
- expect(page).to have_text('Profile')
100
+ expect(page).to have_text('My profile')
101
101
  end
102
102
  end
103
103
  end
104
104
 
105
105
  context 'with no messages' do
106
-
107
- scenario 'visit messages tab' do
108
- visit "/user#messages"
106
+ scenario 'visit messages' do
107
+ visit "/user/messages"
109
108
 
110
109
  expect(page).to have_text('It seems you don\'t have any messages yet!')
111
110
  end
112
111
  end
113
112
 
114
113
  context 'with messages' do
115
- scenario 'visit messages tab' do
114
+ scenario 'visit messages' do
116
115
  Organization.find_by_name('test').switch!
117
116
  problem.submit_solution! user, {content: 'something'}
118
117
  Message.import_from_resource_h! message
119
- visit "/user#messages"
118
+ visit "/user/messages"
120
119
 
121
120
  expect(page).to_not have_text('It seems you don\'t have any messages yet!')
122
121
  expect(page).to have_text(problem.name)
123
122
  end
124
123
  end
125
- end
126
124
 
125
+ context 'visit certificates tab' do
126
+ before { Organization.find_by_name('test').switch! }
127
+ before { create :certificate, user: user, code: 'abc' }
128
+ before { visit '/user/certificates' }
129
+
130
+ scenario { expect(page).to have_text('Test - Certificate program to test') }
131
+ scenario { expect(page).to have_link(href: /certificates\/verify\/abc/) }
132
+ scenario { expect(page).to have_link(href: /linkedin.com\/profile\/add/) }
133
+ scenario { expect(page).to have_link(href: /certificates\/download\/abc/) }
134
+ end
135
+
136
+ end
127
137
  end