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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
6bec7c2a
Commit
6bec7c2a
authored
Mar 15, 2018
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move EE-only elasticsearch specs in spec/models/repository_spec.rb
parent
a102d09a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
42 deletions
+42
-42
ee/spec/models/repository_spec.rb
ee/spec/models/repository_spec.rb
+42
-0
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+0
-42
No files found.
ee/spec/models/repository_spec.rb
View file @
6bec7c2a
...
...
@@ -26,4 +26,46 @@ describe Repository do
repository
.
after_sync
end
end
describe
"Elastic search"
,
:elastic
do
before
do
stub_ee_application_setting
(
elasticsearch_search:
true
,
elasticsearch_indexing:
true
)
Gitlab
::
Elastic
::
Helper
.
create_empty_index
end
after
do
Gitlab
::
Elastic
::
Helper
.
delete_index
stub_ee_application_setting
(
elasticsearch_search:
false
,
elasticsearch_indexing:
false
)
end
describe
"class method find_commits_by_message_with_elastic"
do
it
"returns commits"
do
project
=
create
:project
,
:repository
project1
=
create
:project
,
:repository
project
.
repository
.
index_commits
project1
.
repository
.
index_commits
Gitlab
::
Elastic
::
Helper
.
refresh_index
expect
(
described_class
.
find_commits_by_message_with_elastic
(
'initial'
).
first
).
to
be_a
(
Commit
)
expect
(
described_class
.
find_commits_by_message_with_elastic
(
'initial'
).
count
).
to
eq
(
2
)
expect
(
described_class
.
find_commits_by_message_with_elastic
(
'initial'
).
total_count
).
to
eq
(
2
)
end
end
describe
"find_commits_by_message_with_elastic"
do
it
"returns commits"
do
project
=
create
:project
,
:repository
project
.
repository
.
index_commits
Gitlab
::
Elastic
::
Helper
.
refresh_index
expect
(
project
.
repository
.
find_commits_by_message_with_elastic
(
'initial'
).
first
).
to
be_a
(
Commit
)
expect
(
project
.
repository
.
find_commits_by_message_with_elastic
(
'initial'
).
count
).
to
eq
(
1
)
expect
(
project
.
repository
.
find_commits_by_message_with_elastic
(
'initial'
).
total_count
).
to
eq
(
1
)
end
end
end
end
spec/models/repository_spec.rb
View file @
6bec7c2a
...
...
@@ -1813,48 +1813,6 @@ describe Repository do
end
end
describe
"Elastic search"
,
:elastic
do
before
do
stub_ee_application_setting
(
elasticsearch_search:
true
,
elasticsearch_indexing:
true
)
Gitlab
::
Elastic
::
Helper
.
create_empty_index
end
after
do
Gitlab
::
Elastic
::
Helper
.
delete_index
stub_ee_application_setting
(
elasticsearch_search:
false
,
elasticsearch_indexing:
false
)
end
describe
"class method find_commits_by_message_with_elastic"
do
it
"returns commits"
do
project
=
create
:project
,
:repository
project1
=
create
:project
,
:repository
project
.
repository
.
index_commits
project1
.
repository
.
index_commits
Gitlab
::
Elastic
::
Helper
.
refresh_index
expect
(
described_class
.
find_commits_by_message_with_elastic
(
'initial'
).
first
).
to
be_a
(
Commit
)
expect
(
described_class
.
find_commits_by_message_with_elastic
(
'initial'
).
count
).
to
eq
(
2
)
expect
(
described_class
.
find_commits_by_message_with_elastic
(
'initial'
).
total_count
).
to
eq
(
2
)
end
end
describe
"find_commits_by_message_with_elastic"
do
it
"returns commits"
do
project
=
create
:project
,
:repository
project
.
repository
.
index_commits
Gitlab
::
Elastic
::
Helper
.
refresh_index
expect
(
project
.
repository
.
find_commits_by_message_with_elastic
(
'initial'
).
first
).
to
be_a
(
Commit
)
expect
(
project
.
repository
.
find_commits_by_message_with_elastic
(
'initial'
).
count
).
to
eq
(
1
)
expect
(
project
.
repository
.
find_commits_by_message_with_elastic
(
'initial'
).
total_count
).
to
eq
(
1
)
end
end
end
describe
'#after_create'
do
it
'flushes the exists cache'
do
expect
(
repository
).
to
receive
(
:expire_exists_cache
)
...
...
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