mumuki-laboratory 7.6.1 → 7.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +193 -2
- data/Rakefile +3 -0
- data/app/assets/javascripts/mumuki_laboratory/application.js +0 -1
- data/app/assets/javascripts/mumuki_laboratory/application/assets-loader.js +1 -1
- data/app/assets/javascripts/mumuki_laboratory/application/bridge.js +36 -10
- data/app/assets/javascripts/mumuki_laboratory/application/button.js +90 -1
- data/app/assets/javascripts/mumuki_laboratory/application/codemirror.js +1 -0
- data/app/assets/javascripts/mumuki_laboratory/application/custom-editor.js +46 -4
- data/app/assets/javascripts/mumuki_laboratory/application/discussions.js +14 -13
- data/app/assets/javascripts/mumuki_laboratory/application/kids.js +73 -36
- data/app/assets/javascripts/mumuki_laboratory/application/progress.js +3 -0
- data/app/assets/javascripts/mumuki_laboratory/application/results-renderer.js +51 -0
- data/app/assets/javascripts/mumuki_laboratory/application/submission.js +184 -35
- data/app/assets/stylesheets/mumuki_laboratory/application/_modules.scss +1 -0
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_discussion.scss +43 -5
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kids.scss +3 -3
- data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kindergarten.scss +55 -0
- data/app/controllers/assets_controller.rb +2 -0
- data/app/controllers/concerns/with_authorization.rb +4 -0
- data/app/controllers/concerns/with_user_discussion_validation.rb +14 -0
- data/app/controllers/discussions_controller.rb +6 -14
- data/app/controllers/discussions_messages_controller.rb +10 -1
- data/app/controllers/exercise_solutions_controller.rb +4 -2
- data/app/helpers/application_helper.rb +9 -5
- data/app/helpers/discussions_helper.rb +37 -23
- data/app/helpers/exercise_input_helper.rb +1 -1
- data/app/helpers/icons_helper.rb +3 -3
- data/app/views/book_discussions/index.html.erb +3 -3
- data/app/views/discussions/_message.html.erb +20 -8
- data/app/views/discussions/index.html.erb +0 -1
- data/app/views/discussions/new.html.erb +33 -0
- data/app/views/discussions/show.html.erb +18 -46
- data/app/views/exercise_solutions/_contextualization_results_container.html.erb +1 -1
- data/app/views/exercise_solutions/_results_title.html.erb +2 -2
- data/app/views/exercises/_read_only.html.erb +33 -6
- data/app/views/layouts/_copyright.html.erb +1 -1
- data/app/views/layouts/_discussions.html.erb +21 -3
- data/app/views/layouts/_social_media.html.erb +3 -3
- data/app/views/layouts/_test_results.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/editors/_custom.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/forms/_kids_form.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/forms/_problem_form.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/layouts/_input_bottom.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/layouts/_input_kindergarten.html.erb +40 -0
- data/app/views/layouts/exercise_inputs/layouts/{_input_kids.html.erb → _input_primary.html.erb} +1 -1
- data/app/views/layouts/exercise_inputs/layouts/_input_right.html.erb +1 -1
- data/app/views/layouts/modals/_kids_context.html.erb +1 -8
- data/app/views/user_mailer/1st_reminder.html.erb +3 -3
- data/app/views/user_mailer/1st_reminder.text.erb +1 -1
- data/app/views/user_mailer/2nd_reminder.html.erb +3 -3
- data/app/views/user_mailer/2nd_reminder.text.erb +1 -1
- data/app/views/user_mailer/3rd_reminder.html.erb +3 -3
- data/app/views/user_mailer/3rd_reminder.text.erb +1 -1
- data/app/views/user_mailer/no_submissions_reminder.html.erb +3 -3
- data/app/views/user_mailer/no_submissions_reminder.text.erb +1 -1
- data/config/routes.rb +2 -1
- data/lib/mumuki/laboratory/controllers/results_rendering.rb +1 -2
- data/lib/mumuki/laboratory/locales/en.yml +8 -2
- data/lib/mumuki/laboratory/locales/es.yml +7 -1
- data/lib/mumuki/laboratory/locales/pt.yml +8 -4
- data/lib/mumuki/laboratory/version.rb +1 -1
- data/spec/controllers/confirmations_controller_spec.rb +1 -1
- data/spec/controllers/discussions_messages_controller_spec.rb +73 -0
- data/spec/controllers/exercise_solutions_controller_spec.rb +41 -6
- data/spec/dummy/db/schema.rb +12 -1
- data/spec/features/discussion_flow_spec.rb +190 -0
- data/spec/features/exercise_flow_spec.rb +1 -1
- data/spec/features/menu_bar_spec.rb +88 -7
- data/spec/helpers/breadcrumbs_helper_spec.rb +1 -1
- data/spec/javascripts/bridge-spec.js +5 -0
- data/spec/javascripts/csrf-token-spec.js +7 -0
- data/spec/javascripts/elipsis-spec.js +25 -0
- data/spec/javascripts/results-renderers-spec.js +17 -0
- data/spec/javascripts/spec-helper.js +30 -0
- data/spec/javascripts/speech-bubble-renderer-spec.js +11 -0
- data/spec/javascripts/timeout-spec.js +5 -0
- data/spec/javascripts/timer-spec.js +5 -0
- data/spec/teaspoon_env.rb +187 -0
- metadata +33 -9
- data/app/views/layouts/modals/_new_discussion.html.erb +0 -27
- data/vendor/assets/javascripts/hotjar.js +0 -8
data/spec/dummy/db/schema.rb
CHANGED
@@ -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:
|
13
|
+
ActiveRecord::Schema.define(version: 20200731081757) do
|
14
14
|
|
15
15
|
# These are extensions that must be enabled in order to support this database
|
16
16
|
enable_extension "plpgsql"
|
@@ -117,6 +117,11 @@ ActiveRecord::Schema.define(version: 20200608132959) do
|
|
117
117
|
t.text "manual_evaluation_comment"
|
118
118
|
t.integer "upvotes_count", default: 0
|
119
119
|
t.bigint "organization_id"
|
120
|
+
t.integer "messages_count", default: 0
|
121
|
+
t.integer "validated_messages_count", default: 0
|
122
|
+
t.boolean "requires_moderator_response", default: true
|
123
|
+
t.string "last_moderator_access_by_id"
|
124
|
+
t.datetime "last_moderator_access_at"
|
120
125
|
t.index ["initiator_id"], name: "index_discussions_on_initiator_id"
|
121
126
|
t.index ["item_type", "item_id"], name: "index_discussions_on_item_type_and_item_id"
|
122
127
|
t.index ["organization_id"], name: "index_discussions_on_organization_id"
|
@@ -143,7 +148,11 @@ ActiveRecord::Schema.define(version: 20200608132959) do
|
|
143
148
|
t.integer "max_problem_submissions"
|
144
149
|
t.integer "max_choice_submissions"
|
145
150
|
t.boolean "results_hidden_for_choices", default: false
|
151
|
+
t.bigint "course_id"
|
152
|
+
t.integer "passing_criterion_type", default: 0
|
153
|
+
t.integer "passing_criterion_value"
|
146
154
|
t.index ["classroom_id"], name: "index_exams_on_classroom_id", unique: true
|
155
|
+
t.index ["course_id"], name: "index_exams_on_course_id"
|
147
156
|
t.index ["guide_id"], name: "index_exams_on_guide_id"
|
148
157
|
t.index ["organization_id"], name: "index_exams_on_organization_id"
|
149
158
|
end
|
@@ -288,6 +297,7 @@ ActiveRecord::Schema.define(version: 20200608132959) do
|
|
288
297
|
t.boolean "read", default: false
|
289
298
|
t.integer "discussion_id"
|
290
299
|
t.boolean "approved", default: false
|
300
|
+
t.boolean "not_actually_a_question", default: false
|
291
301
|
end
|
292
302
|
|
293
303
|
create_table "organizations", id: :serial, force: :cascade do |t|
|
@@ -375,6 +385,7 @@ ActiveRecord::Schema.define(version: 20200608132959) do
|
|
375
385
|
t.string "verified_last_name"
|
376
386
|
t.bigint "avatar_id"
|
377
387
|
t.datetime "disabled_at"
|
388
|
+
t.boolean "trusted_for_forum"
|
378
389
|
t.index ["disabled_at"], name: "index_users_on_disabled_at"
|
379
390
|
t.index ["last_organization_id"], name: "index_users_on_last_organization_id"
|
380
391
|
t.index ["uid"], name: "index_users_on_uid", unique: true
|
@@ -0,0 +1,190 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
feature 'Discussion Flow', organization_workspace: :test do
|
4
|
+
|
5
|
+
## =============
|
6
|
+
## Users
|
7
|
+
## =============
|
8
|
+
|
9
|
+
let(:student) { create(:user, permissions: {student: 'test/*:other/*:empty/*'}) }
|
10
|
+
let(:another_student) { create(:user, permissions: {student: 'test/*:other/*:empty/*'}) }
|
11
|
+
let(:moderator) { create(:user, permissions: {moderator: 'test/*:other/*:empty/*', student: 'test/*:other/*:empty/*'}) }
|
12
|
+
|
13
|
+
## =================
|
14
|
+
## Organizations
|
15
|
+
## =================
|
16
|
+
|
17
|
+
let(:test_organization) { Organization.locate! 'test' }
|
18
|
+
let(:other_organization) { create(:organization, name: 'other') }
|
19
|
+
let!(:empty_organization) { create(:organization, name: 'empty') }
|
20
|
+
|
21
|
+
## ================================
|
22
|
+
## Content for test_organization
|
23
|
+
## ================================
|
24
|
+
|
25
|
+
let(:problem_1) { create(:problem) }
|
26
|
+
let(:problem_2) { create(:problem) }
|
27
|
+
let(:problem_3) { create(:problem) }
|
28
|
+
|
29
|
+
let!(:chapter) {
|
30
|
+
create(:chapter, lessons: [create(:lesson, exercises: [ problem_1, problem_2, problem_3])])
|
31
|
+
}
|
32
|
+
|
33
|
+
## =====================================
|
34
|
+
## Discussions for test_organization
|
35
|
+
## =====================================
|
36
|
+
|
37
|
+
let(:problem_2_discussions) { create_list(:discussion, 5, initiator: another_student, item: problem_2, organization: test_organization) }
|
38
|
+
let(:problem_3_discussions) { create_list(:discussion, 5, initiator: student, item: problem_2, organization: test_organization) }
|
39
|
+
let!(:test_organization_discussions) { problem_2_discussions + problem_3_discussions }
|
40
|
+
|
41
|
+
## ===================================
|
42
|
+
## Content for other_organization
|
43
|
+
## ===================================
|
44
|
+
|
45
|
+
let(:other_problem) { create(:problem) }
|
46
|
+
let!(:other_chapter) {
|
47
|
+
create(:chapter, book: other_organization.book, lessons: [create(:lesson, exercises: [other_problem])])
|
48
|
+
}
|
49
|
+
|
50
|
+
## =====================================
|
51
|
+
## Discussions for other_organization
|
52
|
+
## =====================================
|
53
|
+
|
54
|
+
let(:other_problem_discussions) { create_list(:discussion, 5, initiator: student, item: problem_2, organization: other_organization) }
|
55
|
+
let!(:other_organization_discussions) { other_problem_discussions }
|
56
|
+
|
57
|
+
before { reindex_current_organization! }
|
58
|
+
before { reindex_organization! other_organization }
|
59
|
+
before { reindex_organization! empty_organization }
|
60
|
+
|
61
|
+
shared_examples 'no forum access' do
|
62
|
+
scenario 'has no forum access' do
|
63
|
+
visit current_path
|
64
|
+
expect(page).to have_text('You may have mistyped the address or the page may have moved')
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
context 'exercise discussions' do
|
69
|
+
let(:current_path) { "/exercises/#{problem_1.id}/discussions" }
|
70
|
+
|
71
|
+
context 'with no current user' do
|
72
|
+
it_behaves_like 'no forum access'
|
73
|
+
end
|
74
|
+
|
75
|
+
context 'with logged user' do
|
76
|
+
before { set_current_user! student }
|
77
|
+
|
78
|
+
context 'but no forum enabled' do
|
79
|
+
it_behaves_like 'no forum access'
|
80
|
+
end
|
81
|
+
|
82
|
+
context 'and forum enabled' do
|
83
|
+
before { Organization.current.update! forum_enabled: true }
|
84
|
+
|
85
|
+
scenario 'empty discussion list for problem 1' do
|
86
|
+
visit "/exercises/#{problem_1.id}/discussions"
|
87
|
+
expect(page).to have_text(problem_1.name)
|
88
|
+
expect(page).to have_text('It seems there isn\'t any question yet.')
|
89
|
+
end
|
90
|
+
|
91
|
+
scenario 'discussion list for problem 2' do
|
92
|
+
visit "/exercises/#{problem_2.id}/discussions"
|
93
|
+
expect(page).to have_text(problem_2.name)
|
94
|
+
problem_2_discussions.each do |discussion|
|
95
|
+
expect(page).to have_text(discussion.description)
|
96
|
+
end
|
97
|
+
expect(page).to have_text('Didn\'t find what you were looking for?')
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
context 'book discussions' do
|
104
|
+
let(:current_path) { '/discussions' }
|
105
|
+
|
106
|
+
context 'with no current user' do
|
107
|
+
it_behaves_like 'no forum access'
|
108
|
+
end
|
109
|
+
|
110
|
+
context 'with logged user' do
|
111
|
+
before { set_current_user! student }
|
112
|
+
|
113
|
+
context 'but no forum enabled' do
|
114
|
+
it_behaves_like 'no forum access'
|
115
|
+
end
|
116
|
+
|
117
|
+
context 'and forum enabled' do
|
118
|
+
before { Organization.current.update! forum_enabled: true }
|
119
|
+
|
120
|
+
context 'in empty organization' do
|
121
|
+
before { empty_organization.update! forum_enabled: true }
|
122
|
+
before { set_subdomain_host! 'empty' }
|
123
|
+
after { set_subdomain_host! 'test' }
|
124
|
+
|
125
|
+
scenario 'empty discussion list for book without discussions' do
|
126
|
+
visit current_path
|
127
|
+
expect(page).to have_text(empty_organization.book.name)
|
128
|
+
expect(page).to have_text('It seems there isn\'t any question yet.')
|
129
|
+
end
|
130
|
+
|
131
|
+
end
|
132
|
+
|
133
|
+
scenario 'discussion list for book with discussions' do
|
134
|
+
visit current_path
|
135
|
+
expect(page).to have_text(test_organization.book.name)
|
136
|
+
test_organization_discussions.each do |discussion|
|
137
|
+
expect(page).to have_text(discussion.description)
|
138
|
+
end
|
139
|
+
other_organization_discussions.each do |discussion|
|
140
|
+
expect(page).not_to have_text(discussion.description)
|
141
|
+
end
|
142
|
+
expect(page).not_to have_text('Didn\'t find what you were looking for?')
|
143
|
+
expect(page).not_to have_text('It seems there isn\'t any question yet.')
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
context 'exercise discussion' do
|
150
|
+
let(:current_path) { "/exercises/#{problem_2.id}/discussions/#{problem_2_discussions.first.id}" }
|
151
|
+
before { test_organization.switch! }
|
152
|
+
|
153
|
+
context 'with no current user' do
|
154
|
+
it_behaves_like 'no forum access'
|
155
|
+
end
|
156
|
+
|
157
|
+
context 'with logged student' do
|
158
|
+
before { set_current_user! student }
|
159
|
+
|
160
|
+
context 'but no forum enabled' do
|
161
|
+
it_behaves_like 'no forum access'
|
162
|
+
end
|
163
|
+
|
164
|
+
context 'and forum enabled' do
|
165
|
+
before { Organization.current.update! forum_enabled: true }
|
166
|
+
|
167
|
+
scenario 'newly created discussion' do
|
168
|
+
visit current_path
|
169
|
+
expect(page).to have_text(problem_2.name)
|
170
|
+
expect(page).to have_text('Open')
|
171
|
+
expect(page).to have_text('Messages')
|
172
|
+
expect(page).not_to have_xpath("//div[@class='discussion-actions']")
|
173
|
+
end
|
174
|
+
|
175
|
+
context 'for moderator' do
|
176
|
+
before { set_current_user! moderator }
|
177
|
+
|
178
|
+
scenario 'newly created discussion' do
|
179
|
+
visit current_path
|
180
|
+
expect(page).to have_text(problem_2.name)
|
181
|
+
expect(page).to have_text('Open')
|
182
|
+
expect(page).to have_text('Messages')
|
183
|
+
expect(page).to have_xpath("//div[@class='discussion-actions']")
|
184
|
+
end
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
end
|
@@ -17,7 +17,7 @@ feature 'Exercise Flow', organization_workspace: :test do
|
|
17
17
|
let(:playground_2) { build(:playground, name: 'Succ6', description: 'Description of Succ4', layout: :input_right, extra: 'x = 4') }
|
18
18
|
let!(:reading) { build(:reading, name: 'Reading about Succ', description: 'Lets understand succ history') }
|
19
19
|
let!(:exercise_not_in_path) { create :exercise }
|
20
|
-
let(:kids_problem) { build(:problem, name: 'Kids prob', description: 'Description of kids prob', layout: :
|
20
|
+
let(:kids_problem) { build(:problem, name: 'Kids prob', description: 'Description of kids prob', layout: :input_primary, hint: 'lele', language: gobstones) }
|
21
21
|
|
22
22
|
let!(:chapter) {
|
23
23
|
create(:chapter, name: 'Functional Programming', lessons: [
|
@@ -1,7 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
feature 'menu bar' do
|
4
|
-
let(:
|
4
|
+
let(:lesson) { create(:lesson, exercises: create_list(:exercise, 3))}
|
5
|
+
let(:chapter) { create(:chapter, lessons: [lesson]) }
|
5
6
|
let(:book) { create(:book, chapters: [chapter], name: 'private', slug: 'mumuki/mumuki-the-private-book') }
|
6
7
|
let(:private_organization) { create(:organization, name: 'private', book: book) }
|
7
8
|
|
@@ -32,6 +33,8 @@ feature 'menu bar' do
|
|
32
33
|
expect(page).not_to have_text('Profile')
|
33
34
|
expect(page).not_to have_text('Classroom')
|
34
35
|
expect(page).not_to have_text('Bibliotheca')
|
36
|
+
expect(page).not_to have_text('Solve other\'s doubts')
|
37
|
+
expect(page).not_to have_text('My doubts')
|
35
38
|
end
|
36
39
|
end
|
37
40
|
end
|
@@ -52,15 +55,91 @@ feature 'menu bar' do
|
|
52
55
|
expect(page).to have_text('Profile')
|
53
56
|
expect(page).not_to have_text('Classroom')
|
54
57
|
expect(page).not_to have_text('Bibliotheca')
|
58
|
+
expect(page).not_to have_text('Solve other\'s doubts')
|
59
|
+
expect(page).not_to have_text('My doubts')
|
55
60
|
end
|
56
61
|
|
57
|
-
|
58
|
-
|
62
|
+
context 'student with no discussions should' do
|
63
|
+
scenario 'only see profile if forum is not enabled' do
|
64
|
+
set_current_user! student
|
59
65
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
66
|
+
visit '/'
|
67
|
+
expect(page).to have_text('Profile')
|
68
|
+
expect(page).not_to have_text('Classroom')
|
69
|
+
expect(page).not_to have_text('Bibliotheca')
|
70
|
+
expect(page).not_to have_text('Solve other\'s doubts')
|
71
|
+
expect(page).not_to have_text('My doubts')
|
72
|
+
end
|
73
|
+
|
74
|
+
scenario 'see profile and solve_other_doubts links if forum is enabled' do
|
75
|
+
set_current_user! student
|
76
|
+
private_organization.update! forum_enabled: true
|
77
|
+
|
78
|
+
visit '/'
|
79
|
+
expect(page).to have_text('Profile')
|
80
|
+
expect(page).not_to have_text('Classroom')
|
81
|
+
expect(page).not_to have_text('Bibliotheca')
|
82
|
+
expect(page).to have_text('Solve other\'s doubts')
|
83
|
+
expect(page).not_to have_text('My doubts')
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
context 'student with discussions should' do
|
88
|
+
let(:discussion) { create(:discussion, item: lesson.exercises.last, initiator: student)}
|
89
|
+
|
90
|
+
scenario 'only see profile if forum is not enabled' do
|
91
|
+
set_current_user! student
|
92
|
+
student.subscribe_to! discussion
|
93
|
+
|
94
|
+
visit '/'
|
95
|
+
expect(page).to have_text('Profile')
|
96
|
+
expect(page).not_to have_text('Classroom')
|
97
|
+
expect(page).not_to have_text('Bibliotheca')
|
98
|
+
expect(page).not_to have_text('Solve other\'s doubts')
|
99
|
+
expect(page).not_to have_text('My doubts')
|
100
|
+
end
|
101
|
+
|
102
|
+
scenario 'see all discussions links if forum is enabled' do
|
103
|
+
set_current_user! student
|
104
|
+
private_organization.update! forum_enabled: true
|
105
|
+
student.subscribe_to! discussion
|
106
|
+
|
107
|
+
visit '/'
|
108
|
+
expect(page).to have_text('Profile')
|
109
|
+
expect(page).not_to have_text('Classroom')
|
110
|
+
expect(page).not_to have_text('Bibliotheca')
|
111
|
+
expect(page).to have_text('Solve other\'s doubts')
|
112
|
+
expect(page).to have_text('My doubts')
|
113
|
+
end
|
114
|
+
|
115
|
+
scenario 'only see profile if forum is enabled in a forum_only_for_trusted organization' do
|
116
|
+
set_current_user! student
|
117
|
+
student.subscribe_to! discussion
|
118
|
+
private_organization.update! forum_enabled: true
|
119
|
+
private_organization.update! forum_only_for_trusted: true
|
120
|
+
|
121
|
+
visit '/'
|
122
|
+
expect(page).to have_text('Profile')
|
123
|
+
expect(page).not_to have_text('Classroom')
|
124
|
+
expect(page).not_to have_text('Bibliotheca')
|
125
|
+
expect(page).not_to have_text('Solve other\'s doubts')
|
126
|
+
expect(page).not_to have_text('My doubts')
|
127
|
+
end
|
128
|
+
|
129
|
+
scenario 'see all discussions links if forum is enabled in a forum_only_for_trusted organization but it is trusted' do
|
130
|
+
student.update! trusted_for_forum: true
|
131
|
+
set_current_user! student
|
132
|
+
student.subscribe_to! discussion
|
133
|
+
private_organization.update! forum_enabled: true
|
134
|
+
private_organization.update! forum_only_for_trusted: true
|
135
|
+
|
136
|
+
visit '/'
|
137
|
+
expect(page).to have_text('Profile')
|
138
|
+
expect(page).not_to have_text('Classroom')
|
139
|
+
expect(page).not_to have_text('Bibliotheca')
|
140
|
+
expect(page).to have_text('Solve other\'s doubts')
|
141
|
+
expect(page).to have_text('My doubts')
|
142
|
+
end
|
64
143
|
end
|
65
144
|
|
66
145
|
scenario 'teacher should see profile and classroom' do
|
@@ -71,6 +150,8 @@ feature 'menu bar' do
|
|
71
150
|
expect(page).to have_text('Profile')
|
72
151
|
expect(page).to have_text('Classroom')
|
73
152
|
expect(page).not_to have_text('Bibliotheca')
|
153
|
+
expect(page).not_to have_text('Solve other\'s doubts')
|
154
|
+
expect(page).not_to have_text('My doubts')
|
74
155
|
end
|
75
156
|
|
76
157
|
scenario 'writer should see profile and bibliotheca' do
|
@@ -91,7 +91,7 @@ describe BreadcrumbsHelper, organization_workspace: :test do
|
|
91
91
|
expect(breadcrumb).to include('my lesson')
|
92
92
|
expect(breadcrumb).to include('my exercise')
|
93
93
|
expect(breadcrumb).to include('discussions')
|
94
|
-
expect(breadcrumb).to include(discussion.
|
94
|
+
expect(breadcrumb).to include(discussion.item.navigable_name)
|
95
95
|
expect(breadcrumb).to be_html_safe
|
96
96
|
end
|
97
97
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
describe('elipsis', () => {
|
2
|
+
it('does nothing when no elipsis', () => {
|
3
|
+
expect(mumuki.elipsis('hello')).toEqual('hello');
|
4
|
+
})
|
5
|
+
|
6
|
+
it('replaces student elipsis', () => {
|
7
|
+
expect(mumuki.elipsis(`function longitud(unString) {
|
8
|
+
/*<elipsis-for-student@*/
|
9
|
+
return unString.length;
|
10
|
+
/*@elipsis-for-student>*/
|
11
|
+
}`)).toEqual(`function longitud(unString) {
|
12
|
+
/* ... */
|
13
|
+
}`)
|
14
|
+
});
|
15
|
+
|
16
|
+
it('replaces student hidden', () => {
|
17
|
+
expect(mumuki.elipsis(`function longitud(unString) {
|
18
|
+
/*<hidden-for-student@*/
|
19
|
+
return unString.length;
|
20
|
+
/*@hidden-for-student>*/
|
21
|
+
}`)).toEqual(`function longitud(unString) {
|
22
|
+
/**/
|
23
|
+
}`)
|
24
|
+
});
|
25
|
+
})
|
@@ -0,0 +1,17 @@
|
|
1
|
+
describe('results renderers', () => {
|
2
|
+
it('can compute class for status', () => {
|
3
|
+
expect(mumuki.renderers.classForStatus('passed')).toEqual('success');
|
4
|
+
})
|
5
|
+
|
6
|
+
it('can compute icon for status', () => {
|
7
|
+
expect(mumuki.renderers.iconForStatus('pending')).toEqual('fa-circle');
|
8
|
+
})
|
9
|
+
|
10
|
+
it('can compute progress list item for status', () => {
|
11
|
+
expect(mumuki.renderers.progressListItemClassForStatus('passed_with_warnings')).toEqual('progress-list-item text-center warning ');
|
12
|
+
})
|
13
|
+
|
14
|
+
it('can compute progress list item for status when active', () => {
|
15
|
+
expect(mumuki.renderers.progressListItemClassForStatus('failed', true)).toEqual('progress-list-item text-center danger active');
|
16
|
+
})
|
17
|
+
})
|
@@ -0,0 +1,30 @@
|
|
1
|
+
// Teaspoon includes some support files, but you can use anything from your own support path too.
|
2
|
+
// require support/jasmine-jquery-1.7.0
|
3
|
+
// require support/jasmine-jquery-2.0.0
|
4
|
+
// require support/jasmine-jquery-2.1.0
|
5
|
+
// require support/sinon
|
6
|
+
//
|
7
|
+
// PhantomJS (Teaspoons default driver) doesn't have support for Function.prototype.bind, which has caused confusion.
|
8
|
+
// Use this polyfill to avoid the confusion.
|
9
|
+
//
|
10
|
+
// You can require your own javascript files here. By default this will include everything in application, however you
|
11
|
+
// may get better load performance if you require the specific files that are being used in the spec that tests them.
|
12
|
+
//=require mumuki_laboratory/application
|
13
|
+
//
|
14
|
+
// Deferring execution
|
15
|
+
// If you're using CommonJS, RequireJS or some other asynchronous library you can defer execution. Call
|
16
|
+
// Teaspoon.execute() after everything has been loaded. Simple example of a timeout:
|
17
|
+
//
|
18
|
+
// Teaspoon.defer = true
|
19
|
+
// setTimeout(Teaspoon.execute, 1000)
|
20
|
+
//
|
21
|
+
// Matching files
|
22
|
+
// By default Teaspoon will look for files that match _spec.{js,js.coffee,.coffee}. Add a filename_spec.js file in your
|
23
|
+
// spec path and it'll be included in the default suite automatically. If you want to customize suites, check out the
|
24
|
+
// configuration in teaspoon_env.rb
|
25
|
+
//
|
26
|
+
// Manifest
|
27
|
+
// If you'd rather require your spec files manually (to control order for instance) you can disable the suite matcher in
|
28
|
+
// the configuration and use this file as a manifest.
|
29
|
+
//
|
30
|
+
// For more information: http://github.com/modeset/teaspoon
|