Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-04 18:08:40 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-04 18:08:40 +0300
commit6b833f1e0340e00fdee074da9c42c0d4e07a46d2 (patch)
tree6fc3a7a2f8a02fec8d1e7561b453d33eb4048dad /spec/lib/gitlab/diff/formatters/image_formatter_spec.rb
parent88a0824944720b6edaaef56376713541b9a02118 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/diff/formatters/image_formatter_spec.rb')
-rw-r--r--spec/lib/gitlab/diff/formatters/image_formatter_spec.rb40
1 files changed, 27 insertions, 13 deletions
diff --git a/spec/lib/gitlab/diff/formatters/image_formatter_spec.rb b/spec/lib/gitlab/diff/formatters/image_formatter_spec.rb
index 2e6eb71d37d..edf30ffc56f 100644
--- a/spec/lib/gitlab/diff/formatters/image_formatter_spec.rb
+++ b/spec/lib/gitlab/diff/formatters/image_formatter_spec.rb
@@ -3,20 +3,34 @@
require 'spec_helper'
describe Gitlab::Diff::Formatters::ImageFormatter do
- it_behaves_like "position formatter" do
- let(:base_attrs) do
- {
- base_sha: 123,
- start_sha: 456,
- head_sha: 789,
- old_path: 'old_image.png',
- new_path: 'new_image.png',
- position_type: 'image'
- }
- end
+ let(:base_attrs) do
+ {
+ base_sha: 123,
+ start_sha: 456,
+ head_sha: 789,
+ old_path: 'old_image.png',
+ new_path: 'new_image.png',
+ position_type: 'image'
+ }
+ end
+
+ let(:attrs) do
+ base_attrs.merge(width: 100, height: 100, x: 1, y: 2)
+ end
+
+ it_behaves_like 'position formatter'
+
+ describe '#==' do
+ subject { described_class.new(attrs) }
+
+ it { is_expected.to eq(subject) }
+
+ [:width, :height, :x, :y].each do |attr|
+ let(:other_formatter) do
+ described_class.new(attrs.merge(attr => 9))
+ end
- let(:attrs) do
- base_attrs.merge(width: 100, height: 100, x: 1, y: 2)
+ it { is_expected.not_to eq(other_formatter) }
end
end
end