diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-12-11 18:56:53 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-12-11 18:56:53 +0000 |
commit | fcd44484cd427fc75f05e1c8363e9def4b4bf64f (patch) | |
tree | e3181efad22ad409ef98a89592c1911d43f7bdad /spec/models/diff_note_spec.rb | |
parent | 7c68be16a6d364cd40d9fbb6e0878b9f2947bb88 (diff) | |
parent | 4ccbd556d98e002b1c521fd3dd7748fe1d9c4044 (diff) | |
download | gitlab-ce-28869-es6-modules.tar.gz |
Merge branch 'master' into 28869-es6-modules28869-es6-modules
* master: (117 commits)
small change to make less conflict with EE version
Add cop for use of remove_column
Resolve merge conflicts with dev.gitlab.org/master after security release
add index for doc/administration/operations/
Remove RubySampler#sample_objects for performance as well
Bugfix: User can't change the access level of an access requester
Add spec for removing issues.assignee_id
updated imports
Keep track of storage check timings
Remove a header level in the new 'Automatic CE->EE merge' doc
Improve down step of removing issues.assignee_id column
Fix specs after removing assignee_id field
Remove issues.assignee_id column
Resolve conflicts in app/models/user.rb
Fix image view mode
Do not raise when downstream pipeline is created
Remove the need for destroy and add a comment in the spec
Use build instead of create in importer spec
Simplify normalizing of paths
Remove allocation tracking code from InfluxDB sampler for performance
...
Diffstat (limited to 'spec/models/diff_note_spec.rb')
-rw-r--r-- | spec/models/diff_note_spec.rb | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/spec/models/diff_note_spec.rb b/spec/models/diff_note_spec.rb index 8389d5c5430..4d0b3245a13 100644 --- a/spec/models/diff_note_spec.rb +++ b/spec/models/diff_note_spec.rb @@ -9,13 +9,14 @@ describe DiffNote do let(:path) { "files/ruby/popen.rb" } + let(:diff_refs) { merge_request.diff_refs } let!(:position) do Gitlab::Diff::Position.new( old_path: path, new_path: path, old_line: nil, new_line: 14, - diff_refs: merge_request.diff_refs + diff_refs: diff_refs ) end @@ -25,7 +26,7 @@ describe DiffNote do new_path: path, old_line: 16, new_line: 22, - diff_refs: merge_request.diff_refs + diff_refs: diff_refs ) end @@ -158,25 +159,21 @@ describe DiffNote do describe "creation" do describe "updating of position" do context "when noteable is a commit" do - let(:diff_note) { create(:diff_note_on_commit, project: project, position: position) } + let(:diff_refs) { commit.diff_refs } - it "doesn't update the position" do - diff_note + subject { create(:diff_note_on_commit, project: project, position: position, commit_id: commit.id) } - expect(diff_note.original_position).to eq(position) - expect(diff_note.position).to eq(position) + it "doesn't update the position" do + is_expected.to have_attributes(original_position: position, + position: position) end end context "when noteable is a merge request" do - let(:diff_note) { create(:diff_note_on_merge_request, project: project, position: position, noteable: merge_request) } - context "when the note is active" do it "doesn't update the position" do - diff_note - - expect(diff_note.original_position).to eq(position) - expect(diff_note.position).to eq(position) + expect(subject.original_position).to eq(position) + expect(subject.position).to eq(position) end end @@ -186,10 +183,8 @@ describe DiffNote do end it "updates the position" do - diff_note - - expect(diff_note.original_position).to eq(position) - expect(diff_note.position).not_to eq(position) + expect(subject.original_position).to eq(position) + expect(subject.position).not_to eq(position) end end end |