diff options
author | Valery Sizov <valery@gitlab.com> | 2017-03-07 13:42:17 +0200 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2017-03-07 13:42:17 +0200 |
commit | a0108c6925239aab8164c28851d19f5d01eb8321 (patch) | |
tree | b7c03d99ed3684834bae06b5e86641fcaa3bfdfb /spec | |
parent | 710e4df933ba2070dcc104a18de834c23dd1e5be (diff) | |
download | gitlab-ce-a0108c6925239aab8164c28851d19f5d01eb8321.tar.gz |
Address review comments
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/concerns/relative_positioning_spec.rb | 10 | ||||
-rw-r--r-- | spec/services/boards/issues/move_service_spec.rb | 2 | ||||
-rw-r--r-- | spec/services/issues/update_service_spec.rb | 4 |
3 files changed, 4 insertions, 12 deletions
diff --git a/spec/models/concerns/relative_positioning_spec.rb b/spec/models/concerns/relative_positioning_spec.rb index 69f295f725b..81cc1fc8238 100644 --- a/spec/models/concerns/relative_positioning_spec.rb +++ b/spec/models/concerns/relative_positioning_spec.rb @@ -4,6 +4,7 @@ describe Issue, 'RelativePositioning' do let(:project) { create(:empty_project) } let(:issue) { create(:issue, project: project) } let(:issue1) { create(:issue, project: project) } + let(:new_issue) { create(:issue, project: project) } before do [issue, issue1].each do |issue| @@ -36,8 +37,6 @@ describe Issue, 'RelativePositioning' do describe '#move_to_end' do it 'moves issue to the end' do - new_issue = create :issue, project: project - new_issue.move_to_end expect(new_issue.relative_position).to be > issue1.relative_position @@ -46,8 +45,6 @@ describe Issue, 'RelativePositioning' do describe '#move_between' do it 'positions issue between two other' do - new_issue = create :issue, project: project - new_issue.move_between(issue, issue1) expect(new_issue.relative_position).to be > issue.relative_position @@ -55,23 +52,18 @@ describe Issue, 'RelativePositioning' do end it 'positions issue between on top' do - new_issue = create :issue, project: project - new_issue.move_between(nil, issue) expect(new_issue.relative_position).to be < issue.relative_position end it 'positions issue between to end' do - new_issue = create :issue, project: project - new_issue.move_between(issue1, nil) expect(new_issue.relative_position).to be > issue1.relative_position end it 'positions issues even when after and before positions are the same' do - new_issue = create :issue, project: project issue1.update relative_position: issue.relative_position new_issue.move_between(issue, issue1) diff --git a/spec/services/boards/issues/move_service_spec.rb b/spec/services/boards/issues/move_service_spec.rb index afa86f68344..6c9709c808e 100644 --- a/spec/services/boards/issues/move_service_spec.rb +++ b/spec/services/boards/issues/move_service_spec.rb @@ -98,7 +98,7 @@ describe Boards::Issues::MoveService, services: true do issue.move_between!(issue1, issue2) - params.merge! move_after_iid: issue.iid, move_before_iid: issue2.iid + params.merge!(move_after_iid: issue.iid, move_before_iid: issue2.iid) described_class.new(project, user, params).execute(issue1) diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb index 81d6162e04c..fa472f3e2c3 100644 --- a/spec/services/issues/update_service_spec.rb +++ b/spec/services/issues/update_service_spec.rb @@ -59,8 +59,8 @@ describe Issues::UpdateService, services: true do end it 'sorts issues as specified by parameters' do - issue1 = create :issue, project: project, assignee_id: user3.id - issue2 = create :issue, project: project, assignee_id: user3.id + issue1 = create(:issue, project: project, assignee_id: user3.id) + issue2 = create(:issue, project: project, assignee_id: user3.id) [issue, issue1, issue2].each do |issue| issue.move_to_end |