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
b52af92c
Commit
b52af92c
authored
Nov 05, 2020
by
Mike Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add shared examples to snippet replicator
parent
246fbade
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
ee/spec/support/shared_examples/models/concerns/repository_replicator_strategy_shared_examples.rb
...oncerns/repository_replicator_strategy_shared_examples.rb
+1
-0
ee/spec/support/shared_examples/models/concerns/verifiable_replicator_shared_examples.rb
.../models/concerns/verifiable_replicator_shared_examples.rb
+7
-5
No files found.
ee/spec/support/shared_examples/models/concerns/repository_replicator_strategy_shared_examples.rb
View file @
b52af92c
...
...
@@ -19,6 +19,7 @@ RSpec.shared_examples 'a repository replicator' do
end
it_behaves_like
'a replicator'
it_behaves_like
'a verifiable replicator'
# This could be included in each model's spec, but including it here is DRYer.
include_examples
'a replicable model'
...
...
ee/spec/support/shared_examples/models/concerns/verifiable_replicator_shared_examples.rb
View file @
b52af92c
...
...
@@ -49,18 +49,20 @@ RSpec.shared_examples 'a verifiable replicator' do
end
describe
'#calculate_checksum!'
do
it
'calculates the checksum'
do
before
do
model_record
.
save!
end
it
'calculates the checksum'
do
expect
(
model_record
).
to
receive
(
:calculate_checksum!
).
and_return
(
'abc123'
)
replicator
.
calculate_checksum!
expect
(
model_record
.
reload
.
verification_checksum
).
not_to
be_nil
expect
(
model_record
.
reload
.
verified_at
).
not_to
be_nil
expect
(
model_record
.
reload
.
verification_checksum
).
to
eq
(
'abc123'
)
expect
(
model_record
.
verified_at
).
not_to
be_nil
end
it
'saves the error message and increments retry counter'
do
model_record
.
save!
allow
(
model_record
).
to
receive
(
:calculate_checksum!
)
do
raise
StandardError
.
new
(
'Failure to calculate checksum'
)
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