Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
bbfa4a77
Commit
bbfa4a77
authored
Apr 28, 2014
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always set last_fetched_at in NotesFinder spec
parent
0b615eb0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
spec/finders/notes_finder_spec.rb
spec/finders/notes_finder_spec.rb
+3
-3
No files found.
spec/finders/notes_finder_spec.rb
View file @
bbfa4a77
...
@@ -12,25 +12,25 @@ describe NotesFinder do
...
@@ -12,25 +12,25 @@ describe NotesFinder do
end
end
describe
:execute
do
describe
:execute
do
let
(
:params
)
{
{
target_id:
commit
.
id
,
target_type:
'commit'
,
last_fetched_at:
1
.
hour
.
ago
}
}
before
do
before
do
note1
note1
note2
note2
end
end
it
'should find all notes'
do
it
'should find all notes'
do
params
=
{
target_id:
commit
.
id
,
target_type:
'commit'
}
notes
=
NotesFinder
.
new
.
execute
(
project
,
user
,
params
)
notes
=
NotesFinder
.
new
.
execute
(
project
,
user
,
params
)
notes
.
size
.
should
eq
(
2
)
notes
.
size
.
should
eq
(
2
)
end
end
it
'should raise an exception for an invalid target_type'
do
it
'should raise an exception for an invalid target_type'
do
params
=
{
target_id:
commit
.
id
,
target_type:
'invalid'
}
params
.
merge!
(
target_type:
'invalid'
)
expect
{
NotesFinder
.
new
.
execute
(
project
,
user
,
params
)
}.
to
raise_error
(
'invalid target_type'
)
expect
{
NotesFinder
.
new
.
execute
(
project
,
user
,
params
)
}.
to
raise_error
(
'invalid target_type'
)
end
end
it
'filters out old notes'
do
it
'filters out old notes'
do
note2
.
update_attribute
(
:updated_at
,
2
.
hours
.
ago
)
note2
.
update_attribute
(
:updated_at
,
2
.
hours
.
ago
)
params
=
{
target_id:
commit
.
id
,
target_type:
'commit'
,
last_fetched_at:
1
.
hour
.
ago
}
notes
=
NotesFinder
.
new
.
execute
(
project
,
user
,
params
)
notes
=
NotesFinder
.
new
.
execute
(
project
,
user
,
params
)
notes
.
should
eq
([
note1
])
notes
.
should
eq
([
note1
])
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