diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-05-17 17:36:27 +0300 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2018-05-22 14:36:31 +0300 |
commit | f3a09f49e4a011f1943f2159b0992a15c5db436d (patch) | |
tree | 7924fccb9799d4b00dcb9e2309c8b31b52512123 /spec | |
parent | ab4df99b0b1b59e69df1325ec06d2cd15fad1ab2 (diff) |
Merge branch '46177-fix-present-on-generic-commit-status' into 'master'
Resolve "NoMethodError: undefined method `present' for #<GenericCommitStatus:0x00007f6eacf34a40>"
Closes #46177
See merge request gitlab-org/gitlab-ce!18979
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/commit_status_spec.rb | 6 | ||||
-rw-r--r-- | spec/models/generic_commit_status_spec.rb | 6 | ||||
-rw-r--r-- | spec/presenters/ci/build_presenter_spec.rb | 2 | ||||
-rw-r--r-- | spec/presenters/commit_status_presenter_spec.rb | 15 |
4 files changed, 28 insertions, 1 deletions
diff --git a/spec/models/commit_status_spec.rb b/spec/models/commit_status_spec.rb index 2ed29052dc1..f3f2bc28d2c 100644 --- a/spec/models/commit_status_spec.rb +++ b/spec/models/commit_status_spec.rb @@ -565,4 +565,10 @@ describe CommitStatus do it_behaves_like 'commit status enqueued' end end + + describe '#present' do + subject { commit_status.present } + + it { is_expected.to be_a(CommitStatusPresenter) } + end end diff --git a/spec/models/generic_commit_status_spec.rb b/spec/models/generic_commit_status_spec.rb index 673049d1cc4..a3e68d2e646 100644 --- a/spec/models/generic_commit_status_spec.rb +++ b/spec/models/generic_commit_status_spec.rb @@ -78,4 +78,10 @@ describe GenericCommitStatus do it { is_expected.not_to be_nil } end end + + describe '#present' do + subject { generic_commit_status.present } + + it { is_expected.to be_a(GenericCommitStatusPresenter) } + end end diff --git a/spec/presenters/ci/build_presenter_spec.rb b/spec/presenters/ci/build_presenter_spec.rb index 4bc005df2fc..efd175247b5 100644 --- a/spec/presenters/ci/build_presenter_spec.rb +++ b/spec/presenters/ci/build_presenter_spec.rb @@ -10,7 +10,7 @@ describe Ci::BuildPresenter do end it 'inherits from Gitlab::View::Presenter::Delegated' do - expect(described_class.superclass).to eq(Gitlab::View::Presenter::Delegated) + expect(described_class.ancestors).to include(Gitlab::View::Presenter::Delegated) end describe '#initialize' do diff --git a/spec/presenters/commit_status_presenter_spec.rb b/spec/presenters/commit_status_presenter_spec.rb new file mode 100644 index 00000000000..f81ee44e371 --- /dev/null +++ b/spec/presenters/commit_status_presenter_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +describe CommitStatusPresenter do + let(:project) { create(:project) } + let(:pipeline) { create(:ci_pipeline, project: project) } + let(:build) { create(:ci_build, pipeline: pipeline) } + + subject(:presenter) do + described_class.new(build) + end + + it 'inherits from Gitlab::View::Presenter::Delegated' do + expect(described_class.superclass).to eq(Gitlab::View::Presenter::Delegated) + end +end |