diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-06-22 23:00:54 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-06-22 23:00:54 +0300 |
commit | 15a05be70d7652a98f870c5b5d02373dabf363e0 (patch) | |
tree | 970f32c6d3fb705c5626b503dee5e683049f5c8e /spec/services | |
parent | 88328392918deeb459c1d991559f9b40b5fc1026 (diff) |
Fix Style/Blocks cop violations
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/archive_repository_service_spec.rb | 4 | ||||
-rw-r--r-- | spec/services/git_push_service_spec.rb | 12 | ||||
-rw-r--r-- | spec/services/issues/bulk_update_service_spec.rb | 20 |
3 files changed, 16 insertions, 20 deletions
diff --git a/spec/services/archive_repository_service_spec.rb b/spec/services/archive_repository_service_spec.rb index ff62b02a5b1..a7a783ea2e4 100644 --- a/spec/services/archive_repository_service_spec.rb +++ b/spec/services/archive_repository_service_spec.rb @@ -17,9 +17,7 @@ describe ArchiveRepositoryService do end it "raises an error" do - expect { - subject.execute(timeout: 0.0) - }.to raise_error + expect { subject.execute(timeout: 0.0) }.to raise_error end end diff --git a/spec/services/git_push_service_spec.rb b/spec/services/git_push_service_spec.rb index 2807d735eec..b3e59d7a0db 100644 --- a/spec/services/git_push_service_spec.rb +++ b/spec/services/git_push_service_spec.rb @@ -218,18 +218,18 @@ describe GitPushService do end it "doesn't create cross-reference notes for a closing reference" do - expect { + expect do service.execute(project, user, @oldrev, @newrev, @ref) - }.not_to change { Note.where(project_id: project.id, system: true, commit_id: closing_commit.id).count } + end.not_to change { Note.where(project_id: project.id, system: true, commit_id: closing_commit.id).count } end it "doesn't close issues when pushed to non-default branches" do project.stub(default_branch: 'durf') # The push still shouldn't create cross-reference notes. - expect { + expect do service.execute(project, user, @oldrev, @newrev, 'refs/heads/hurf') - }.not_to change { Note.where(project_id: project.id, system: true).count } + end.not_to change { Note.where(project_id: project.id, system: true).count } expect(Issue.find(issue.id)).to be_opened end @@ -238,9 +238,9 @@ describe GitPushService do allow(project).to receive(:default_issues_tracker?).and_return(false) # The push still shouldn't create cross-reference notes. - expect { + expect do service.execute(project, user, @oldrev, @newrev, 'refs/heads/hurf') - }.not_to change { Note.where(project_id: project.id, system: true).count } + end.not_to change { Note.where(project_id: project.id, system: true).count } end end diff --git a/spec/services/issues/bulk_update_service_spec.rb b/spec/services/issues/bulk_update_service_spec.rb index a97c55011c9..4c62fbafd73 100644 --- a/spec/services/issues/bulk_update_service_spec.rb +++ b/spec/services/issues/bulk_update_service_spec.rb @@ -1,9 +1,7 @@ require 'spec_helper' describe Issues::BulkUpdateService do - let(:issue) { - create(:issue, project: @project) - } + let(:issue) { create(:issue, project: @project) } before do @user = create :user @@ -26,14 +24,14 @@ describe Issues::BulkUpdateService do } end - it { + it do result = Issues::BulkUpdateService.new(@project, @user, @params).execute expect(result[:success]).to be_truthy expect(result[:count]).to eq(@issues.count) expect(@project.issues.opened).to be_empty expect(@project.issues.closed).not_to be_empty - } + end end @@ -49,14 +47,14 @@ describe Issues::BulkUpdateService do } end - it { + it do result = Issues::BulkUpdateService.new(@project, @user, @params).execute expect(result[:success]).to be_truthy expect(result[:count]).to eq(@issues.count) expect(@project.issues.closed).to be_empty expect(@project.issues.opened).not_to be_empty - } + end end @@ -70,13 +68,13 @@ describe Issues::BulkUpdateService do } end - it { + it do result = Issues::BulkUpdateService.new(@project, @user, @params).execute expect(result[:success]).to be_truthy expect(result[:count]).to eq(1) expect(@project.issues.first.assignee).to eq(@new_assignee) - } + end it 'allows mass-unassigning' do @project.issues.first.update_attribute(:assignee, @new_assignee) @@ -109,13 +107,13 @@ describe Issues::BulkUpdateService do } end - it { + it do result = Issues::BulkUpdateService.new(@project, @user, @params).execute expect(result[:success]).to be_truthy expect(result[:count]).to eq(1) expect(@project.issues.first.milestone).to eq(@milestone) - } + end end end |