Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cs_comments_service
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
cs_comments_service
Commits
5b85a216
Commit
5b85a216
authored
Aug 04, 2012
by
Rocky Duan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed unnecesary files
parent
207f5bed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
47 deletions
+0
-47
spec/models/content_spec.rb
+0
-47
No files found.
spec/models/content_spec.rb
deleted
100644 → 0
View file @
207f5bed
require
'spec_helper'
describe
Content
do
before
:each
do
@text
=
"""
hi @tom, I have a question from @pi314 about the following code:
```
class A
def set_some_variable
@some_variable = 1
end
end
```
and also the following code
class A
def get_some_variable
@some_variable
end
end
what is the 'at' symbol doing there? @dementrock
"""
User
.
delete_all
User
.
create!
(
external_id:
"1"
,
username:
"tom"
,
email:
"tom@test.com"
)
User
.
create!
(
external_id:
"2"
,
username:
"pi314"
,
email:
"pi314@test.com"
)
end
describe
"#get_marked_text(text)"
do
it
"returns marked at text"
do
converted
=
Content
.
get_marked_text
(
@text
)
converted
.
should
include
"@tom_0"
converted
.
should
include
"@pi314_1"
converted
.
should
include
"@some_variable_2"
converted
.
should
include
"@some_variable_3"
converted
.
should
include
"@dementrock_4"
end
end
describe
"#get_valid_at_position_list(text)"
do
it
"returns the list of positions for the valid @ notifications, filtering out the ones in code blocks"
do
list
=
Content
.
get_valid_at_position_list
(
@text
)
list
.
should
include
({
position:
0
,
username:
"tom"
,
user_id:
"1"
})
list
.
should
include
({
position:
1
,
username:
"pi314"
,
user_id:
"2"
})
list
.
length
.
should
==
2
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment