diff options
author | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2015-02-12 21:17:35 +0300 |
---|---|---|
committer | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2015-02-12 21:17:35 +0300 |
commit | 0c4a70a306b871899bf87ce4673918abfee4d95f (patch) | |
tree | c7a702fb511209ffe0eceba245d1ffea71dce1aa /spec/services/issues | |
parent | de1c450abd6b367390a1295cac402344f500d41d (diff) |
Updated rspec to rspec 3.x syntax
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
Diffstat (limited to 'spec/services/issues')
-rw-r--r-- | spec/services/issues/bulk_update_context_spec.rb | 28 | ||||
-rw-r--r-- | spec/services/issues/close_service_spec.rb | 10 | ||||
-rw-r--r-- | spec/services/issues/create_service_spec.rb | 4 | ||||
-rw-r--r-- | spec/services/issues/update_service_spec.rb | 20 |
4 files changed, 31 insertions, 31 deletions
diff --git a/spec/services/issues/bulk_update_context_spec.rb b/spec/services/issues/bulk_update_context_spec.rb index f4c9148f1a3..eb867f78c5c 100644 --- a/spec/services/issues/bulk_update_context_spec.rb +++ b/spec/services/issues/bulk_update_context_spec.rb @@ -30,11 +30,11 @@ describe Issues::BulkUpdateService do it { result = Issues::BulkUpdateService.new(@project, @user, @params).execute - result[:success].should be_true - result[:count].should == @issues.count + expect(result[:success]).to be_truthy + expect(result[:count]).to eq(@issues.count) - @project.issues.opened.should be_empty - @project.issues.closed.should_not be_empty + expect(@project.issues.opened).to be_empty + expect(@project.issues.closed).not_to be_empty } end @@ -55,11 +55,11 @@ describe Issues::BulkUpdateService do it { result = Issues::BulkUpdateService.new(@project, @user, @params).execute - result[:success].should be_true - result[:count].should == @issues.count + expect(result[:success]).to be_truthy + expect(result[:count]).to eq(@issues.count) - @project.issues.closed.should be_empty - @project.issues.opened.should_not be_empty + expect(@project.issues.closed).to be_empty + expect(@project.issues.opened).not_to be_empty } end @@ -78,10 +78,10 @@ describe Issues::BulkUpdateService do it { result = Issues::BulkUpdateService.new(@project, @user, @params).execute - result[:success].should be_true - result[:count].should == 1 + expect(result[:success]).to be_truthy + expect(result[:count]).to eq(1) - @project.issues.first.assignee.should == @new_assignee + expect(@project.issues.first.assignee).to eq(@new_assignee) } end @@ -100,10 +100,10 @@ describe Issues::BulkUpdateService do it { result = Issues::BulkUpdateService.new(@project, @user, @params).execute - result[:success].should be_true - result[:count].should == 1 + expect(result[:success]).to be_truthy + expect(result[:count]).to eq(1) - @project.issues.first.milestone.should == @milestone + expect(@project.issues.first.milestone).to eq(@milestone) } end diff --git a/spec/services/issues/close_service_spec.rb b/spec/services/issues/close_service_spec.rb index d4f2cc1339b..d15dff1b52b 100644 --- a/spec/services/issues/close_service_spec.rb +++ b/spec/services/issues/close_service_spec.rb @@ -17,18 +17,18 @@ describe Issues::CloseService do @issue = Issues::CloseService.new(project, user, {}).execute(issue) end - it { @issue.should be_valid } - it { @issue.should be_closed } + it { expect(@issue).to be_valid } + it { expect(@issue).to be_closed } it 'should send email to user2 about assign of new issue' do email = ActionMailer::Base.deliveries.last - email.to.first.should == user2.email - email.subject.should include(issue.title) + expect(email.to.first).to eq(user2.email) + expect(email.subject).to include(issue.title) end it 'should create system note about issue reassign' do note = @issue.notes.last - note.note.should include "Status changed to closed" + expect(note.note).to include "Status changed to closed" end end end diff --git a/spec/services/issues/create_service_spec.rb b/spec/services/issues/create_service_spec.rb index 90720be5ded..7f1ebcb3198 100644 --- a/spec/services/issues/create_service_spec.rb +++ b/spec/services/issues/create_service_spec.rb @@ -16,8 +16,8 @@ describe Issues::CreateService do @issue = Issues::CreateService.new(project, user, opts).execute end - it { @issue.should be_valid } - it { @issue.title.should == 'Awesome issue' } + it { expect(@issue).to be_valid } + it { expect(@issue.title).to eq('Awesome issue') } end end end diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb index 964b3a707e4..22b89bec96d 100644 --- a/spec/services/issues/update_service_spec.rb +++ b/spec/services/issues/update_service_spec.rb @@ -27,27 +27,27 @@ describe Issues::UpdateService do @issue.reload end - it { @issue.should be_valid } - it { @issue.title.should == 'New title' } - it { @issue.assignee.should == user2 } - it { @issue.should be_closed } - it { @issue.labels.count.should == 1 } - it { @issue.labels.first.title.should == 'Bug' } + it { expect(@issue).to be_valid } + it { expect(@issue.title).to eq('New title') } + it { expect(@issue.assignee).to eq(user2) } + it { expect(@issue).to be_closed } + it { expect(@issue.labels.count).to eq(1) } + it { expect(@issue.labels.first.title).to eq('Bug') } it 'should send email to user2 about assign of new issue' do email = ActionMailer::Base.deliveries.last - email.to.first.should == user2.email - email.subject.should include(issue.title) + expect(email.to.first).to eq(user2.email) + expect(email.subject).to include(issue.title) end it 'should create system note about issue reassign' do note = @issue.notes.last - note.note.should include "Reassigned to \@#{user2.username}" + expect(note.note).to include "Reassigned to \@#{user2.username}" end it 'should create system note about issue label edit' do note = @issue.notes[1] - note.note.should include "Added ~#{label.id} label" + expect(note.note).to include "Added ~#{label.id} label" end end end |