diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-07-20 15:17:42 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-07-20 15:17:42 +0300 |
commit | e9862a9900c6269a41b65ca543035e57b49fede3 (patch) | |
tree | c2ed1f1a906ccb240f8a27d28e2b86ffdddbf3f1 /spec/services/ci | |
parent | c9c715cd5510456d83da5272f28b7ce7f248c77f (diff) |
Use struct instead of hash
Diffstat (limited to 'spec/services/ci')
-rw-r--r-- | spec/services/ci/create_trigger_request_service_spec.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/spec/services/ci/create_trigger_request_service_spec.rb b/spec/services/ci/create_trigger_request_service_spec.rb index 48d9b0844f1..37ca9804f56 100644 --- a/spec/services/ci/create_trigger_request_service_spec.rb +++ b/spec/services/ci/create_trigger_request_service_spec.rb @@ -17,26 +17,26 @@ describe Ci::CreateTriggerRequestService, services: true do subject { service.execute(project, trigger, 'master') } context 'without owner' do - it { expect(subject[:trigger_request]).to be_kind_of(Ci::TriggerRequest) } - it { expect(subject[:trigger_request].builds.first).to be_kind_of(Ci::Build) } - it { expect(subject[:pipeline]).to be_kind_of(Ci::Pipeline) } - it { expect(subject[:pipeline]).to be_trigger } + it { expect(subject.trigger_request).to be_kind_of(Ci::TriggerRequest) } + it { expect(subject.trigger_request.builds.first).to be_kind_of(Ci::Build) } + it { expect(subject.pipeline).to be_kind_of(Ci::Pipeline) } + it { expect(subject.pipeline).to be_trigger } end context 'with owner' do - it { expect(subject[:trigger_request]).to be_kind_of(Ci::TriggerRequest) } - it { expect(subject[:trigger_request].builds.first).to be_kind_of(Ci::Build) } - it { expect(subject[:trigger_request].builds.first.user).to eq(owner) } - it { expect(subject[:pipeline]).to be_kind_of(Ci::Pipeline) } - it { expect(subject[:pipeline]).to be_trigger } - it { expect(subject[:pipeline].user).to eq(owner) } + it { expect(subject.trigger_request).to be_kind_of(Ci::TriggerRequest) } + it { expect(subject.trigger_request.builds.first).to be_kind_of(Ci::Build) } + it { expect(subject.trigger_request.builds.first.user).to eq(owner) } + it { expect(subject.pipeline).to be_kind_of(Ci::Pipeline) } + it { expect(subject.pipeline).to be_trigger } + it { expect(subject.pipeline.user).to eq(owner) } end end context 'no commit for ref' do subject { service.execute(project, trigger, 'other-branch') } - it { expect(subject[:pipeline]).not_to be_persisted } + it { expect(subject.pipeline).not_to be_persisted } end context 'no builds created' do @@ -46,7 +46,7 @@ describe Ci::CreateTriggerRequestService, services: true do stub_ci_pipeline_yaml_file('script: { only: [develop], script: hello World }') end - it { expect(subject[:pipeline]).not_to be_persisted } + it { expect(subject.pipeline).not_to be_persisted } end end end |