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
5a7a3f42
Commit
5a7a3f42
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/project_spec.rb
parent
6bec7c2a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
40 deletions
+44
-40
ee/spec/models/project_spec.rb
ee/spec/models/project_spec.rb
+44
-0
spec/models/project_spec.rb
spec/models/project_spec.rb
+0
-40
No files found.
ee/spec/models/project_spec.rb
View file @
5a7a3f42
...
...
@@ -1312,4 +1312,48 @@ describe Project do
expect
(
project
.
user_can_push_to_empty_repo?
(
user
)).
to
be_falsey
end
end
describe
'project import state transitions'
do
context
'state transition: [:started] => [:finished]'
do
context
'elasticsearch indexing disabled'
do
before
do
stub_ee_application_setting
(
elasticsearch_indexing:
false
)
end
it
'does not index the repository'
do
project
=
create
(
:project
,
:import_started
,
import_type: :github
)
expect
(
ElasticCommitIndexerWorker
).
not_to
receive
(
:perform_async
)
project
.
import_finish
end
end
context
'elasticsearch indexing enabled'
do
let
(
:project
)
{
create
(
:project
,
:import_started
,
import_type: :github
)
}
before
do
stub_ee_application_setting
(
elasticsearch_indexing:
true
)
end
context
'no index status'
do
it
'schedules a full index of the repository'
do
expect
(
ElasticCommitIndexerWorker
).
to
receive
(
:perform_async
).
with
(
project
.
id
,
nil
)
project
.
import_finish
end
end
context
'with index status'
do
let!
(
:index_status
)
{
project
.
create_index_status!
(
indexed_at:
Time
.
now
,
last_commit:
'foo'
)
}
it
'schedules a progressive index of the repository'
do
expect
(
ElasticCommitIndexerWorker
).
to
receive
(
:perform_async
).
with
(
project
.
id
,
index_status
.
last_commit
)
project
.
import_finish
end
end
end
end
end
end
spec/models/project_spec.rb
View file @
5a7a3f42
...
...
@@ -1846,46 +1846,6 @@ describe Project do
expect
(
housekeeping_service
).
not_to
have_received
(
:execute
)
end
context
'elasticsearch indexing disabled'
do
before
do
stub_ee_application_setting
(
elasticsearch_indexing:
false
)
end
it
'does not index the repository'
do
project
=
create
(
:project
,
:import_started
,
import_type: :github
)
expect
(
ElasticCommitIndexerWorker
).
not_to
receive
(
:perform_async
)
project
.
import_finish
end
end
context
'elasticsearch indexing enabled'
do
let
(
:project
)
{
create
(
:project
,
:import_started
,
import_type: :github
)
}
before
do
stub_ee_application_setting
(
elasticsearch_indexing:
true
)
end
context
'no index status'
do
it
'schedules a full index of the repository'
do
expect
(
ElasticCommitIndexerWorker
).
to
receive
(
:perform_async
).
with
(
project
.
id
,
nil
)
project
.
import_finish
end
end
context
'with index status'
do
let!
(
:index_status
)
{
project
.
create_index_status!
(
indexed_at:
Time
.
now
,
last_commit:
'foo'
)
}
it
'schedules a progressive index of the repository'
do
expect
(
ElasticCommitIndexerWorker
).
to
receive
(
:perform_async
).
with
(
project
.
id
,
index_status
.
last_commit
)
project
.
import_finish
end
end
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