diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-08-29 22:08:40 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-09-01 00:33:14 +0300 |
commit | debb65b5c81094765b2aa515a20e964cd8a14b6f (patch) | |
tree | f80182d66c1f7372eedbb4c8ebb40822ea6b296e /spec/services/issues/close_service_spec.rb | |
parent | 44340fede26278a7f9d70e0fb063df9673cfc551 (diff) |
Update service specs to avoid instance variables
Diffstat (limited to 'spec/services/issues/close_service_spec.rb')
-rw-r--r-- | spec/services/issues/close_service_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/services/issues/close_service_spec.rb b/spec/services/issues/close_service_spec.rb index 229c8eb5b5b..4df99e41987 100644 --- a/spec/services/issues/close_service_spec.rb +++ b/spec/services/issues/close_service_spec.rb @@ -18,12 +18,12 @@ describe Issues::CloseService, services: true do context "valid params" do before do perform_enqueued_jobs do - @issue = described_class.new(project, user).execute(issue) + described_class.new(project, user).execute(issue) end end - it { expect(@issue).to be_valid } - it { expect(@issue).to be_closed } + it { expect(issue).to be_valid } + it { expect(issue).to be_closed } it 'sends email to user2 about assign of new issue' do email = ActionMailer::Base.deliveries.last @@ -32,7 +32,7 @@ describe Issues::CloseService, services: true do end it 'creates system note about issue reassign' do - note = @issue.notes.last + note = issue.notes.last expect(note.note).to include "Status changed to closed" end @@ -44,12 +44,12 @@ describe Issues::CloseService, services: true do context 'current user is not authorized to close issue' do before do perform_enqueued_jobs do - @issue = described_class.new(project, guest).execute(issue) + described_class.new(project, guest).execute(issue) end end it 'does not close the issue' do - expect(@issue).to be_open + expect(issue).to be_open end end @@ -67,11 +67,11 @@ describe Issues::CloseService, services: true do context 'external issue tracker' do before do allow(project).to receive(:default_issues_tracker?).and_return(false) - @issue = described_class.new(project, user).execute(issue) + described_class.new(project, user).execute(issue) end - it { expect(@issue).to be_valid } - it { expect(@issue).to be_opened } + it { expect(issue).to be_valid } + it { expect(issue).to be_opened } it { expect(todo.reload).to be_pending } end end |